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.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_quick_AES256EncryptRound
val va_quick_AES256EncryptRound (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n))
val va_quick_AES256EncryptRound (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n))
let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 819, "start_col": 0, "start_line": 815 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> init: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound n)
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCode.va_QProc", "Prims.unit", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Vale.AES.PPC64LE.AES256.va_wp_AES256EncryptRound", "Vale.AES.PPC64LE.AES256.va_wpProof_AES256EncryptRound", "Vale.PPC64LE.QuickCode.va_quickCode" ]
[]
false
false
false
false
false
let va_quick_AES256EncryptRound (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) =
(va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_AES256EncryptRound
val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))
val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))
let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 779, "start_col": 0, "start_line": 768 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> n: Vale.PPC64LE.Memory.nat8 -> init: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.AES.AES_BE_s.eval_rounds_def", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptRound" ]
[]
false
false
false
false
false
let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer =
let va_mods:va_mods_t = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_codegen_success_AES256EncryptRound
val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool
val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool
let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ()))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 20, "end_line": 736, "start_col": 0, "start_line": 731 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> Vale.PPC64LE.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Decls.va_pbool_and", "Vale.PPC64LE.InsBasic.va_codegen_success_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_codegen_success_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_codegen_success_Vcipher", "Vale.PPC64LE.Decls.va_ttrue", "Vale.PPC64LE.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_AES256EncryptRound n =
(va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ()))))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptRound
val va_qcode_AES256EncryptRound (va_mods: va_mods_t) (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n))
val va_qcode_AES256EncryptRound (va_mods: va_mods_t) (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n))
let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (()))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 13, "end_line": 749, "start_col": 0, "start_line": 739 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ()))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> n: Vale.PPC64LE.Memory.nat8 -> init: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound n)
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_code_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_code_Vcipher", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.QuickCodes.va_range1", "Vale.PPC64LE.InsBasic.va_quick_LoadImm64", "Vale.PPC64LE.InsVector.va_quick_Load128_byte16_buffer_index", "Vale.PPC64LE.InsVector.va_quick_Vcipher", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound" ]
[]
false
false
false
false
false
let va_qcode_AES256EncryptRound (va_mods: va_mods_t) (n: nat8) (init: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) =
(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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (()))))))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_codegen_success_AES256EncryptRound_6way
val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool
val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool
let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ())))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 48, "end_line": 980, "start_col": 0, "start_line": 969 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> Vale.PPC64LE.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Decls.va_pbool_and", "Vale.PPC64LE.InsBasic.va_codegen_success_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_codegen_success_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_codegen_success_Vcipher", "Vale.PPC64LE.Decls.va_ttrue", "Vale.PPC64LE.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_AES256EncryptRound_6way n =
(va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ())))))))))
false
LowStar.Comment.fst
LowStar.Comment.comment_gen
val comment_gen: #t: Type -> before: string -> body: t -> after: string -> Pure t (requires (True)) (ensures (fun res -> res == body))
val comment_gen: #t: Type -> before: string -> body: t -> after: string -> Pure t (requires (True)) (ensures (fun res -> res == body))
let comment_gen #t before body after = body
{ "file_name": "ulib/LowStar.Comment.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 6, "end_line": 5, "start_col": 0, "start_line": 3 }
module LowStar.Comment
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "LowStar.Comment.fst" }
[ { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "LowStar", "short_module": null }, { "abbrev": false, "full_module": "LowStar", "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
before: Prims.string -> body: t -> after: Prims.string -> Prims.Pure t
Prims.Pure
[]
[]
[ "Prims.string" ]
[]
false
false
false
false
false
let comment_gen #t before body after =
body
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundOdd256
val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))
val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))
let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 361, "start_col": 0, "start_line": 338 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> round: Vale.PPC64LE.Memory.nat8 -> dst: Vale.PPC64LE.Memory.buffer128 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.buffer128", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_mem_heaplet", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Vale.PPC64LE.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_KeyExpansionRoundOdd256", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.PPC64LE.Decls.validDstAddrs128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.PPC64LE.Decls.buffer128_read", "Prims.op_Addition", "Vale.AES.AES256_helpers_BE.expand_key_256", "Vale.PPC64LE.Decls.modifies_buffer_specific128", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_KeyExpansionRoundOdd256" ]
[]
false
false
false
false
false
let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key =
let va_mods:va_mods_t = [ va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way
val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code
val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code
let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ()))))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 92, "end_line": 965, "start_col": 0, "start_line": 956 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> Vale.PPC64LE.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Decls.va_Block", "Vale.PPC64LE.Decls.va_CCons", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_code_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_code_Vcipher", "Vale.PPC64LE.Decls.va_CNil", "Vale.PPC64LE.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_AES256EncryptRound_6way n =
(va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ()))))))))))
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lemma_table_sub_len
val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> Lemma (i * len + len <= table_len * len)
val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> Lemma (i * len + len <= table_len * len)
let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 55, "end_line": 29, "start_col": 0, "start_line": 27 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} ->
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Prims.nat -> table_len: Prims.nat -> i: Prims.nat{i < table_len} -> FStar.Pervasives.Lemma (ensures i * len + len <= table_len * len)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "FStar.Math.Lemmas.lemma_mult_le_right", "Prims.op_Addition", "Prims.unit", "FStar.Math.Lemmas.distributivity_add_left" ]
[]
true
false
true
false
false
let lemma_table_sub_len len table_len i =
Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptRound_6way
val va_qcode_AES256EncryptRound_6way (va_mods: va_mods_t) (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n))
val va_qcode_AES256EncryptRound_6way (va_mods: va_mods_t) (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n))
let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (())))))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 18, "end_line": 1009, "start_col": 0, "start_line": 983 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ())))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> n: Vale.PPC64LE.Memory.nat8 -> init1: Vale.PPC64LE.Memory.quad32 -> init2: Vale.PPC64LE.Memory.quad32 -> init3: Vale.PPC64LE.Memory.quad32 -> init4: Vale.PPC64LE.Memory.quad32 -> init5: Vale.PPC64LE.Memory.quad32 -> init6: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way n)
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_code_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_code_Vcipher", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.QuickCodes.va_range1", "Vale.PPC64LE.InsBasic.va_quick_LoadImm64", "Vale.PPC64LE.InsVector.va_quick_Load128_byte16_buffer_index", "Vale.PPC64LE.InsVector.va_quick_Vcipher", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way" ]
[]
false
false
false
false
false
let va_qcode_AES256EncryptRound_6way (va_mods: va_mods_t) (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) =
(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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (())))))))))))
false
Vale.AES.X64.AESopt.fsti
Vale.AES.X64.AESopt.va_wp_Loop6x
val va_wp_Loop6x (alg: algorithm) (h_LE y_orig y_prev: quad32) (count: nat) (iv_b in0_b in_b out_b scratch_b: buffer128) (plain_quads: (seq quad32)) (key_words: (seq nat32)) (round_keys: (seq quad32)) (keys_b hkeys_b: buffer128) (ctr_BE_orig ctr_BE: quad32) (va_s0: va_state) (va_k: (va_state -> quad32 -> Type0)) : Type0
val va_wp_Loop6x (alg: algorithm) (h_LE y_orig y_prev: quad32) (count: nat) (iv_b in0_b in_b out_b scratch_b: buffer128) (plain_quads: (seq quad32)) (key_words: (seq nat32)) (round_keys: (seq quad32)) (keys_b hkeys_b: buffer128) (ctr_BE_orig ctr_BE: quad32) (va_s0: va_state) (va_k: (va_state -> quad32 -> Type0)) : Type0
let va_wp_Loop6x (alg:algorithm) (h_LE:quad32) (y_orig:quad32) (y_prev:quad32) (count:nat) (iv_b:buffer128) (in0_b:buffer128) (in_b:buffer128) (out_b:buffer128) (scratch_b:buffer128) (plain_quads:(seq quad32)) (key_words:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (hkeys_b:buffer128) (ctr_BE_orig:quad32) (ctr_BE:quad32) (va_s0:va_state) (va_k:(va_state -> quad32 -> Type0)) : Type0 = (va_get_ok va_s0 /\ (sse_enabled /\ movbe_enabled /\ count >= 2 /\ va_get_reg64 rRdx va_s0 >= 6 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b ((count - 1) `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRsi va_s0) out_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR9 va_s0 - 32) hkeys_b 8 (va_get_mem_layout va_s0) Secret /\ Vale.AES.GCTR.partial_seq_agreement plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in_b) (count `op_Multiply` 6) (count `op_Multiply` 6 + 6) /\ (Vale.X64.Decls.buffers_disjoint128 in_b out_b \/ in_b == out_b) /\ in0_b == out_b /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ va_get_reg64 rR14 va_s0 + 96 < pow2_64 /\ va_get_reg64 rRsi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ pclmulqdq_enabled /\ h_LE == Vale.AES.AES_s.aes_encrypt_LE alg key_words (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0) /\ Vale.AES.GHash.hkeys_reqs_priv (Vale.X64.Decls.s128 (va_get_mem_heaplet 0 va_s0) hkeys_b) (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) /\ scratch_reqs scratch_b (count - 2) (va_get_mem_heaplet 3 va_s0) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_s0) /\ y_prev == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) 0 ((count - 2) `op_Multiply` 6)) /\ y_prev == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))))) /\ count `op_Multiply` 6 + 6 < pow2_32 /\ ctr_BE == Vale.AES.GCTR.inc32lite ctr_BE_orig (count `op_Multiply` 6) /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` count) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) out_b) key_words ctr_BE_orig) /\ (forall (va_x_mem:vale_heap) (va_x_rdi:nat64) (va_x_rsi:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r11:nat64) (va_x_r12:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_xmm0:quad32) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) (va_x_xmm7:quad32) (va_x_xmm8:quad32) (va_x_xmm9:quad32) (va_x_xmm10:quad32) (va_x_xmm11:quad32) (va_x_xmm12:quad32) (va_x_xmm13:quad32) (va_x_xmm14:quad32) (va_x_xmm15:quad32) (va_x_heap6:vale_heap) (va_x_heap2:vale_heap) (va_x_heap3:vale_heap) (va_x_efl:Vale.X64.Flags.t) (y_new:quad32) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 3 va_x_heap3 (va_upd_mem_heaplet 2 va_x_heap2 (va_upd_mem_heaplet 6 va_x_heap6 (va_upd_xmm 15 va_x_xmm15 (va_upd_xmm 14 va_x_xmm14 (va_upd_xmm 13 va_x_xmm13 (va_upd_xmm 12 va_x_xmm12 (va_upd_xmm 11 va_x_xmm11 (va_upd_xmm 10 va_x_xmm10 (va_upd_xmm 9 va_x_xmm9 (va_upd_xmm 8 va_x_xmm8 (va_upd_xmm 7 va_x_xmm7 (va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_xmm 0 va_x_xmm0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR12 va_x_r12 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRsi va_x_rsi (va_upd_reg64 rRdi va_x_rdi (va_upd_mem va_x_mem va_s0)))))))))))))))))))))))))))) in va_get_ok va_sM /\ ((va_get_reg64 rRdx va_sM > 0 ==> Vale.X64.Decls.modifies_buffer_specific128 out_b (va_get_mem_heaplet 6 va_s0) (va_get_mem_heaplet 6 va_sM) (count `op_Multiply` 6 + 0) (count `op_Multiply` 6 + 5)) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_mem_heaplet 6 va_sM == va_get_mem_heaplet 6 va_s0) /\ Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 6 /\ va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0 + 96 /\ va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 + 96 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 + 96 /\ va_get_xmm 15 va_sM == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ (let z3' = va_if (va_get_reg64 rRdx va_sM = 0) (fun _ -> va_get_xmm 7 va_sM) (fun _ -> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10)) in (va_get_reg64 rRbx va_sM + 6 < 256 ==> (va_get_xmm 1 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, z3', va_get_xmm 3 va_sM) == xor_reverse_inc32lite_6 0 6 ctr_BE (va_get_xmm 15 va_sM)) /\ va_get_reg64 rRbx va_sM == Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6) `op_Modulus` 256 /\ (va_get_reg64 rRdx va_sM == 0 ==> Vale.AES.GCTR.gctr_registers (va_get_xmm 9 va_sM) (va_get_xmm 10 va_sM) (va_get_xmm 11 va_sM) (va_get_xmm 12 va_sM) (va_get_xmm 13 va_sM) (va_get_xmm 14 va_sM) plain_quads alg key_words ctr_BE_orig count) /\ (let inout4' = va_if (va_get_reg64 rRbx va_sM + 6 < 256) (fun _ -> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10)) (fun _ -> va_get_xmm 13 va_sM) in (va_get_reg64 rRdx va_sM > 0 ==> (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == (Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6)) (va_get_xmm 15 va_sM), va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, inout4', va_get_xmm 3 va_sM)) /\ (va_get_reg64 rRdx va_sM > 0 ==> make_six_of #Vale.X64.Decls.quad32 (fun (i:(va_int_range 0 5)) -> Vale.X64.Decls.buffer128_read out_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM)) == make_six_of #Vale.X64.Decls.quad32 (fun (i:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_s0)) (Vale.AES.GCTR.aes_encrypt_BE alg key_words (Vale.AES.GCTR.inc32lite ctr_BE i)))) /\ (va_get_reg64 rRdx va_sM > 0 ==> Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` (count + 1)) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) out_b) key_words ctr_BE_orig) /\ y_new == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) in0_b) 0 ((count - 1) `op_Multiply` 6)) /\ (va_get_reg64 rRdx va_sM > 0 ==> y_new == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))))) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_xmm 8 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 y_new) /\ (va_get_reg64 rRdx va_sM > 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_sM)) /\ (va_get_reg64 rRdx va_sM == 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM)))))) ==> va_k va_sM ((y_new))))
{ "file_name": "obj/Vale.AES.X64.AESopt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 21, "end_line": 865, "start_col": 0, "start_line": 759 }
module Vale.AES.X64.AESopt open FStar.Mul open Vale.Def.Prop_s open Vale.Def.Opaque_s open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Seq open Vale.Arch.Types open Vale.Arch.HeapImpl open Vale.AES.AES_s 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.InsVector open Vale.X64.InsAes open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.AES.AES_helpers //open Vale.Poly1305.Math // For lemma_poly_bits64() open Vale.AES.GCM_helpers open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Arch.TypesNative open Vale.X64.CPU_Features_s open Vale.Math.Poly2_s open Vale.AES.GF128_s open Vale.AES.GF128 open Vale.AES.GHash open Vale.AES.X64.PolyOps open Vale.AES.X64.AESopt2 open Vale.AES.X64.AESGCM_expected_code open Vale.Transformers.Transform open FStar.Mul let aes_reqs0 (alg:algorithm) (key:seq nat32) (round_keys:seq quad32) (keys_b:buffer128) (key_ptr:int) (heap0:vale_heap) (layout:vale_heap_layout) : prop0 = aesni_enabled /\ pclmulqdq_enabled /\ avx_enabled /\ alg = AES_128 /\ //(alg = AES_128 || alg = AES_256) /\ is_aes_key_LE alg key /\ length(round_keys) == nr(alg) + 1 /\ round_keys == key_to_round_keys_LE alg key /\ validSrcAddrsOffset128 heap0 key_ptr keys_b 8 (nr alg + 1 - 8) layout Secret /\ buffer128_as_seq heap0 keys_b == round_keys let aes_reqs_offset (alg:algorithm) (key:seq nat32) (round_keys:seq quad32) (keys_b:buffer128) (key_ptr:int) (heap0:vale_heap) (layout:vale_heap_layout) : prop0 = aesni_enabled /\ avx_enabled /\ pclmulqdq_enabled /\ (alg = AES_128 || alg = AES_256) /\ is_aes_key_LE alg key /\ length(round_keys) == nr(alg) + 1 /\ round_keys == key_to_round_keys_LE alg key /\ validSrcAddrsOffset128 heap0 key_ptr keys_b 8 (nr alg + 1 - 8) layout Secret /\ s128 heap0 keys_b == round_keys let six_of (a:Type0) = a & a & a & a & a & a let quad32_6 = six_of quad32 unfold let make_six_of (#a:Type0) (f:(n:nat{n < 6}) -> GTot a) : GTot (six_of a) = (f 0, f 1, f 2, f 3, f 4, f 5) unfold let map_six_of (#a #b:Type0) (x:six_of a) (f:a -> GTot b) : GTot (six_of b) = let (x0, x1, x2, x3, x4, x5) = x in (f x0, f x1, f x2, f x3, f x4, f x5) unfold let map2_six_of (#a #b #c:Type0) (x:six_of a) (y:six_of b) (f:a -> b -> GTot c) : GTot (six_of c) = let (x0, x1, x2, x3, x4, x5) = x in let (y0, y1, y2, y3, y4, y5) = y in (f x0 y0, f x1 y1, f x2 y2, f x3 y3, f x4 y4, f x5 y5) let rounds_opaque_6 (init:quad32_6) (round_keys:seq quad32) (rnd:nat{rnd < length round_keys}) : GTot quad32_6 = map_six_of init (fun x -> eval_rounds x round_keys rnd) let xor_reverse_inc32lite_6 (n i0:int) (ctr_BE rndkey:quad32) : GTot quad32_6 = make_six_of (fun i -> let r = reverse_bytes_quad32 (inc32lite ctr_BE (i0 + i)) in if i < n then quad32_xor r rndkey else r) //let scratch_reqs (scratch_b:buffer128) (count:nat) (heap3:vale_heap) (s:seq quad32) (z3:quad32) : prop0 = // count * 6 + 6 <= length s /\ ( // let data = slice s (count * 6) (count * 6 + 6) in // z3 == reverse_bytes_quad32 (index data 5) /\ // scratch_b_blocks true true scratch_b 8 5 heap3 data) let scratch_reqs (scratch_b:buffer128) (count:nat) (heap3:vale_heap) (s:seq quad32) (z3:quad32) : prop0 = count * 6 + 6 <= length s /\ ( let data = slice s (count * 6) (count * 6 + 6) in z3 == reverse_bytes_quad32 (index data 5) /\ buffer128_read scratch_b 3 heap3 == reverse_bytes_quad32 (index data 4) /\ buffer128_read scratch_b 4 heap3 == reverse_bytes_quad32 (index data 3) /\ buffer128_read scratch_b 5 heap3 == reverse_bytes_quad32 (index data 2) /\ buffer128_read scratch_b 6 heap3 == reverse_bytes_quad32 (index data 1) /\ buffer128_read scratch_b 7 heap3 == reverse_bytes_quad32 (index data 0)) //-- Load_two_lsb val va_code_Load_two_lsb : dst:va_operand_xmm -> Tot va_code val va_codegen_success_Load_two_lsb : dst:va_operand_xmm -> Tot va_pbool val va_lemma_Load_two_lsb : va_b0:va_code -> va_s0:va_state -> dst:va_operand_xmm -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Load_two_lsb dst) va_s0 /\ va_is_dst_xmm dst va_s0 /\ va_get_ok va_s0 /\ sse_enabled)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_xmm va_sM dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 2 0 0 0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM (va_update_operand_xmm dst va_sM va_s0)))))) [@ va_qattr] let va_wp_Load_two_lsb (dst:va_operand_xmm) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_xmm dst va_s0 /\ va_get_ok va_s0 /\ sse_enabled /\ (forall (va_x_dst:va_value_xmm) (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_operand_xmm dst va_x_dst va_s0)) in va_get_ok va_sM /\ va_eval_xmm va_sM dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 2 0 0 0 ==> va_k va_sM (()))) val va_wpProof_Load_two_lsb : dst:va_operand_xmm -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Load_two_lsb dst va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Load_two_lsb dst) ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Load_two_lsb (dst:va_operand_xmm) : (va_quickCode unit (va_code_Load_two_lsb dst)) = (va_QProc (va_code_Load_two_lsb dst) ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) (va_wp_Load_two_lsb dst) (va_wpProof_Load_two_lsb dst)) //-- //-- Load_one_lsb val va_code_Load_one_lsb : dst:va_operand_xmm -> Tot va_code val va_codegen_success_Load_one_lsb : dst:va_operand_xmm -> Tot va_pbool val va_lemma_Load_one_lsb : va_b0:va_code -> va_s0:va_state -> dst:va_operand_xmm -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Load_one_lsb dst) va_s0 /\ va_is_dst_xmm dst va_s0 /\ va_get_ok va_s0 /\ sse_enabled)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_eval_xmm va_sM dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 1 0 0 0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_ok va_sM (va_update_operand_xmm dst va_sM va_s0)))))) [@ va_qattr] let va_wp_Load_one_lsb (dst:va_operand_xmm) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_xmm dst va_s0 /\ va_get_ok va_s0 /\ sse_enabled /\ (forall (va_x_dst:va_value_xmm) (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_operand_xmm dst va_x_dst va_s0)) in va_get_ok va_sM /\ va_eval_xmm va_sM dst == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 1 0 0 0 ==> va_k va_sM (()))) val va_wpProof_Load_one_lsb : dst:va_operand_xmm -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Load_one_lsb dst va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Load_one_lsb dst) ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Load_one_lsb (dst:va_operand_xmm) : (va_quickCode unit (va_code_Load_one_lsb dst)) = (va_QProc (va_code_Load_one_lsb dst) ([va_Mod_flags; va_Mod_reg64 rR11; va_mod_xmm dst]) (va_wp_Load_one_lsb dst) (va_wpProof_Load_one_lsb dst)) //-- //-- Loop6x_final val va_code_Loop6x_final : alg:algorithm -> Tot va_code val va_codegen_success_Loop6x_final : alg:algorithm -> Tot va_pbool val va_lemma_Loop6x_final : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> iv_b:buffer128 -> scratch_b:buffer128 -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> ctr_orig:quad32 -> init:quad32_6 -> ctrs:quad32_6 -> plain:quad32_6 -> inb:quad32 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop6x_final alg) va_s0 /\ va_get_ok va_s0 /\ (sse_enabled /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ va_get_reg64 rRsi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ init == map_six_of #quad32 #quad32 ctrs (fun (c:quad32) -> Vale.Def.Types_s.quad32_xor c (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0)) /\ (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == rounds_opaque_6 init round_keys (Vale.AES.AES_common_s.nr alg - 1) /\ va_get_reg64 rR13 va_s0 == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.hi64 inb) /\ va_get_reg64 rR12 va_s0 == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.lo64 inb) /\ (let rk = FStar.Seq.Base.index #quad32 round_keys (Vale.AES.AES_common_s.nr alg) in (va_get_xmm 2 va_s0, va_get_xmm 0 va_s0, va_get_xmm 5 va_s0, va_get_xmm 6 va_s0, va_get_xmm 7 va_s0, va_get_xmm 3 va_s0) == map_six_of #quad32 #quad32 plain (fun (p:quad32) -> Vale.Def.Types_s.quad32_xor rk p) /\ Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_s0) == Vale.Def.Types_s.reverse_bytes_quad32 ctr_orig)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 7 7 /\ Vale.X64.Decls.buffer128_read scratch_b 7 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 inb /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == map2_six_of #quad32 #quad32 #quad32 plain ctrs (fun (p:quad32) (c:quad32) -> Vale.Def.Types_s.quad32_xor p (Vale.AES.AES_s.aes_encrypt_LE alg key_words c)) /\ va_get_xmm 15 va_sM == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0 + 96 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 + 96 /\ va_get_xmm 2 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_sM == Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_s0) /\ (let ctr = Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_orig `op_Modulus` 256 in ctr + 6 < 256 ==> (va_get_xmm 1 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM) == xor_reverse_inc32lite_6 0 0 ctr_orig (va_get_xmm 15 va_sM))) /\ va_state_eq va_sM (va_update_mem_heaplet 3 va_sM (va_update_flags va_sM (va_update_xmm 15 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_xmm 7 va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR12 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop6x_final (alg:algorithm) (iv_b:buffer128) (scratch_b:buffer128) (key_words:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (ctr_orig:quad32) (init:quad32_6) (ctrs:quad32_6) (plain:quad32_6) (inb:quad32) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (sse_enabled /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ va_get_reg64 rRsi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ init == map_six_of #quad32 #quad32 ctrs (fun (c:quad32) -> Vale.Def.Types_s.quad32_xor c (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0)) /\ (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == rounds_opaque_6 init round_keys (Vale.AES.AES_common_s.nr alg - 1) /\ va_get_reg64 rR13 va_s0 == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.hi64 inb) /\ va_get_reg64 rR12 va_s0 == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.lo64 inb) /\ (let rk = FStar.Seq.Base.index #quad32 round_keys (Vale.AES.AES_common_s.nr alg) in (va_get_xmm 2 va_s0, va_get_xmm 0 va_s0, va_get_xmm 5 va_s0, va_get_xmm 6 va_s0, va_get_xmm 7 va_s0, va_get_xmm 3 va_s0) == map_six_of #quad32 #quad32 plain (fun (p:quad32) -> Vale.Def.Types_s.quad32_xor rk p) /\ Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_s0) == Vale.Def.Types_s.reverse_bytes_quad32 ctr_orig)) /\ (forall (va_x_mem:vale_heap) (va_x_rdi:nat64) (va_x_rsi:nat64) (va_x_r11:nat64) (va_x_r12:nat64) (va_x_r13:nat64) (va_x_xmm0:quad32) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) (va_x_xmm7:quad32) (va_x_xmm9:quad32) (va_x_xmm10:quad32) (va_x_xmm11:quad32) (va_x_xmm12:quad32) (va_x_xmm13:quad32) (va_x_xmm14:quad32) (va_x_xmm15:quad32) (va_x_efl:Vale.X64.Flags.t) (va_x_heap3:vale_heap) . let va_sM = va_upd_mem_heaplet 3 va_x_heap3 (va_upd_flags va_x_efl (va_upd_xmm 15 va_x_xmm15 (va_upd_xmm 14 va_x_xmm14 (va_upd_xmm 13 va_x_xmm13 (va_upd_xmm 12 va_x_xmm12 (va_upd_xmm 11 va_x_xmm11 (va_upd_xmm 10 va_x_xmm10 (va_upd_xmm 9 va_x_xmm9 (va_upd_xmm 7 va_x_xmm7 (va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_xmm 0 va_x_xmm0 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR12 va_x_r12 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rRsi va_x_rsi (va_upd_reg64 rRdi va_x_rdi (va_upd_mem va_x_mem va_s0))))))))))))))))))))) in va_get_ok va_sM /\ (Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 7 7 /\ Vale.X64.Decls.buffer128_read scratch_b 7 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 inb /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == map2_six_of #quad32 #quad32 #quad32 plain ctrs (fun (p:quad32) (c:quad32) -> Vale.Def.Types_s.quad32_xor p (Vale.AES.AES_s.aes_encrypt_LE alg key_words c)) /\ va_get_xmm 15 va_sM == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0 + 96 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 + 96 /\ va_get_xmm 2 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_sM == Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_s0) /\ (let ctr = Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_orig `op_Modulus` 256 in ctr + 6 < 256 ==> (va_get_xmm 1 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM) == xor_reverse_inc32lite_6 0 0 ctr_orig (va_get_xmm 15 va_sM))) ==> va_k va_sM (()))) val va_wpProof_Loop6x_final : alg:algorithm -> iv_b:buffer128 -> scratch_b:buffer128 -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> ctr_orig:quad32 -> init:quad32_6 -> ctrs:quad32_6 -> plain:quad32_6 -> inb:quad32 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop6x_final alg iv_b scratch_b key_words round_keys keys_b ctr_orig init ctrs plain inb va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop6x_final alg) ([va_Mod_mem_heaplet 3; va_Mod_flags; va_Mod_xmm 15; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_xmm 7; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR13; va_Mod_reg64 rR12; va_Mod_reg64 rR11; va_Mod_reg64 rRsi; va_Mod_reg64 rRdi; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop6x_final (alg:algorithm) (iv_b:buffer128) (scratch_b:buffer128) (key_words:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (ctr_orig:quad32) (init:quad32_6) (ctrs:quad32_6) (plain:quad32_6) (inb:quad32) : (va_quickCode unit (va_code_Loop6x_final alg)) = (va_QProc (va_code_Loop6x_final alg) ([va_Mod_mem_heaplet 3; va_Mod_flags; va_Mod_xmm 15; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_xmm 7; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR13; va_Mod_reg64 rR12; va_Mod_reg64 rR11; va_Mod_reg64 rRsi; va_Mod_reg64 rRdi; va_Mod_mem]) (va_wp_Loop6x_final alg iv_b scratch_b key_words round_keys keys_b ctr_orig init ctrs plain inb) (va_wpProof_Loop6x_final alg iv_b scratch_b key_words round_keys keys_b ctr_orig init ctrs plain inb)) //-- //-- Loop6x_save_output val va_code_Loop6x_save_output : va_dummy:unit -> Tot va_code val va_codegen_success_Loop6x_save_output : va_dummy:unit -> Tot va_pbool val va_lemma_Loop6x_save_output : va_b0:va_code -> va_s0:va_state -> count:nat -> out_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Loop6x_save_output ()) va_s0 /\ va_get_ok va_s0 /\ (avx_enabled /\ sse_enabled /\ Vale.X64.Decls.validDstAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRsi va_s0 - 96) out_b (count `op_Multiply` 6) 6 (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 /\ (Vale.X64.Decls.modifies_buffer_specific128 out_b (va_get_mem_heaplet 6 va_s0) (va_get_mem_heaplet 6 va_sM) (count `op_Multiply` 6 + 0) (count `op_Multiply` 6 + 5) /\ FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 6 va_sM) out_b) 0 (6 `op_Multiply` count) == FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 6 va_s0) out_b) 0 (6 `op_Multiply` count) /\ (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == make_six_of #quad32 (fun (i:(va_int_range 0 5)) -> Vale.X64.Decls.buffer128_read out_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM)) /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == (Vale.Def.Types_s.quad32_xor (va_get_xmm 1 va_sM) (va_get_xmm 15 va_sM), va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 6 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@ va_qattr] let va_wp_Loop6x_save_output (count:nat) (out_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (avx_enabled /\ sse_enabled /\ Vale.X64.Decls.validDstAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRsi va_s0 - 96) out_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_xmm9:quad32) (va_x_xmm10:quad32) (va_x_xmm11:quad32) (va_x_xmm12:quad32) (va_x_xmm13:quad32) (va_x_xmm14:quad32) (va_x_heap6:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 6 va_x_heap6 (va_upd_xmm 14 va_x_xmm14 (va_upd_xmm 13 va_x_xmm13 (va_upd_xmm 12 va_x_xmm12 (va_upd_xmm 11 va_x_xmm11 (va_upd_xmm 10 va_x_xmm10 (va_upd_xmm 9 va_x_xmm9 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (Vale.X64.Decls.modifies_buffer_specific128 out_b (va_get_mem_heaplet 6 va_s0) (va_get_mem_heaplet 6 va_sM) (count `op_Multiply` 6 + 0) (count `op_Multiply` 6 + 5) /\ FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 6 va_sM) out_b) 0 (6 `op_Multiply` count) == FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 6 va_s0) out_b) 0 (6 `op_Multiply` count) /\ (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == make_six_of #quad32 (fun (i:(va_int_range 0 5)) -> Vale.X64.Decls.buffer128_read out_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM)) /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == (Vale.Def.Types_s.quad32_xor (va_get_xmm 1 va_sM) (va_get_xmm 15 va_sM), va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM)) ==> va_k va_sM (()))) val va_wpProof_Loop6x_save_output : count:nat -> out_b:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Loop6x_save_output count out_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop6x_save_output ()) ([va_Mod_flags; va_Mod_mem_heaplet 6; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop6x_save_output (count:nat) (out_b:buffer128) : (va_quickCode unit (va_code_Loop6x_save_output ())) = (va_QProc (va_code_Loop6x_save_output ()) ([va_Mod_flags; va_Mod_mem_heaplet 6; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_mem]) (va_wp_Loop6x_save_output count out_b) (va_wpProof_Loop6x_save_output count out_b)) //-- //-- Loop6x_partial val va_code_untransformedoriginal_Loop6x_partial : alg:algorithm -> Tot va_code val va_codegen_success_untransformedoriginal_Loop6x_partial : alg:algorithm -> Tot va_pbool val va_lemma_untransformedoriginal_Loop6x_partial : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> h_LE:quad32 -> y_prev:quad32 -> data:(seq quad32) -> count:nat -> in0_count:nat -> iv_b:buffer128 -> in0_b:buffer128 -> in_b:buffer128 -> scratch_b:buffer128 -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> hkeys_b:buffer128 -> ctr_BE:quad32 -> Ghost (va_state & va_fuel & quad32_6) (requires (va_require_total va_b0 (va_code_untransformedoriginal_Loop6x_partial alg) va_s0 /\ va_get_ok va_s0 /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in sse_enabled /\ movbe_enabled /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b (in0_count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ FStar.Seq.Base.length #quad32 data == 6 /\ hkeys_b_powers hkeys_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rR9 va_s0 - 32) h /\ scratch_b_data true true scratch_b 8 5 (va_get_mem_heaplet 3 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rRbp va_s0) data /\ va_get_xmm 7 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (va_subscript_FStar__Seq__Base__seq data 5) /\ add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))) == prev))) (ensures (fun (va_sM, va_fM, init) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ (0 <= va_get_reg64 rRbx va_sM /\ va_get_reg64 rRbx va_sM < 256) /\ va_get_reg64 rRbx va_sM == Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6) `op_Modulus` 256 /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == rounds_opaque_6 init round_keys (Vale.AES.AES_common_s.nr alg - 1) /\ va_get_reg64 rR13 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.hi64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ va_get_reg64 rR12 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.lo64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ (let rk = FStar.Seq.Base.index #quad32 round_keys (Vale.AES.AES_common_s.nr alg) in (va_get_xmm 2 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM) == make_six_of #quad32 (fun (i:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor rk (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM))) /\ Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 5) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 3 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 4) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 4 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 3) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 5 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 2) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 6 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 1) (va_get_mem_heaplet 6 va_s0)) /\ init == make_six_of #quad32 (fun (n:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE n)) (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0)) /\ (let eventual_Xi = add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM)) in eventual_Xi == Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GHash.ghash_incremental h_LE y_prev data))))) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 3 va_sM (va_update_mem_heaplet 2 va_sM (va_update_xmm 15 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_xmm 8 va_sM (va_update_xmm 7 va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR12 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rRbx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))))) val va_transform_Loop6x_partial : alg:algorithm -> Tot va_transformation_result val va_code_Loop6x_partial : alg:algorithm -> Tot va_code val va_codegen_success_Loop6x_partial : alg:algorithm -> Tot va_pbool val va_lemma_Loop6x_partial : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> h_LE:quad32 -> y_prev:quad32 -> data:(seq quad32) -> count:nat -> in0_count:nat -> iv_b:buffer128 -> in0_b:buffer128 -> in_b:buffer128 -> scratch_b:buffer128 -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> hkeys_b:buffer128 -> ctr_BE:quad32 -> Ghost (va_state & va_fuel & quad32_6) (requires (va_require_total va_b0 (va_code_Loop6x_partial alg) va_s0 /\ va_get_ok va_s0 /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in sse_enabled /\ movbe_enabled /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b (in0_count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ FStar.Seq.Base.length #quad32 data == 6 /\ hkeys_b_powers hkeys_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rR9 va_s0 - 32) h /\ scratch_b_data true true scratch_b 8 5 (va_get_mem_heaplet 3 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rRbp va_s0) data /\ va_get_xmm 7 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (va_subscript_FStar__Seq__Base__seq data 5) /\ add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))) == prev))) (ensures (fun (va_sM, va_fM, init) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ (0 <= va_get_reg64 rRbx va_sM /\ va_get_reg64 rRbx va_sM < 256) /\ va_get_reg64 rRbx va_sM == Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6) `op_Modulus` 256 /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == rounds_opaque_6 init round_keys (Vale.AES.AES_common_s.nr alg - 1) /\ va_get_reg64 rR13 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.hi64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ va_get_reg64 rR12 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.lo64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ (let rk = FStar.Seq.Base.index #quad32 round_keys (Vale.AES.AES_common_s.nr alg) in (va_get_xmm 2 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM) == make_six_of #quad32 (fun (i:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor rk (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM))) /\ Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 5) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 3 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 4) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 4 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 3) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 5 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 2) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 6 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 1) (va_get_mem_heaplet 6 va_s0)) /\ init == make_six_of #quad32 (fun (n:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE n)) (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0)) /\ (let eventual_Xi = add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM)) in eventual_Xi == Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GHash.ghash_incremental h_LE y_prev data))))) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 3 va_sM (va_update_mem_heaplet 2 va_sM (va_update_xmm 15 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_xmm 8 va_sM (va_update_xmm 7 va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR12 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rRbx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))))) [@ va_qattr] let va_wp_Loop6x_partial (alg:algorithm) (h_LE:quad32) (y_prev:quad32) (data:(seq quad32)) (count:nat) (in0_count:nat) (iv_b:buffer128) (in0_b:buffer128) (in_b:buffer128) (scratch_b:buffer128) (key_words:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (hkeys_b:buffer128) (ctr_BE:quad32) (va_s0:va_state) (va_k:(va_state -> quad32_6 -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in sse_enabled /\ movbe_enabled /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b (in0_count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ FStar.Seq.Base.length #quad32 data == 6 /\ hkeys_b_powers hkeys_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rR9 va_s0 - 32) h /\ scratch_b_data true true scratch_b 8 5 (va_get_mem_heaplet 3 va_s0) (va_get_mem_layout va_s0) (va_get_reg64 rRbp va_s0) data /\ va_get_xmm 7 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (va_subscript_FStar__Seq__Base__seq data 5) /\ add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))) == prev) /\ (forall (va_x_mem:vale_heap) (va_x_rbx:nat64) (va_x_r11:nat64) (va_x_r12:nat64) (va_x_r13:nat64) (va_x_xmm0:quad32) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) (va_x_xmm7:quad32) (va_x_xmm8:quad32) (va_x_xmm9:quad32) (va_x_xmm10:quad32) (va_x_xmm11:quad32) (va_x_xmm12:quad32) (va_x_xmm13:quad32) (va_x_xmm14:quad32) (va_x_xmm15:quad32) (va_x_heap2:vale_heap) (va_x_heap3:vale_heap) (va_x_efl:Vale.X64.Flags.t) (init:quad32_6) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 3 va_x_heap3 (va_upd_mem_heaplet 2 va_x_heap2 (va_upd_xmm 15 va_x_xmm15 (va_upd_xmm 14 va_x_xmm14 (va_upd_xmm 13 va_x_xmm13 (va_upd_xmm 12 va_x_xmm12 (va_upd_xmm 11 va_x_xmm11 (va_upd_xmm 10 va_x_xmm10 (va_upd_xmm 9 va_x_xmm9 (va_upd_xmm 8 va_x_xmm8 (va_upd_xmm 7 va_x_xmm7 (va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_xmm 0 va_x_xmm0 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR12 va_x_r12 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rRbx va_x_rbx (va_upd_mem va_x_mem va_s0))))))))))))))))))))))) in va_get_ok va_sM /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) in let (prev:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 y_prev) in Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ (0 <= va_get_reg64 rRbx va_sM /\ va_get_reg64 rRbx va_sM < 256) /\ va_get_reg64 rRbx va_sM == Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6) `op_Modulus` 256 /\ (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == rounds_opaque_6 init round_keys (Vale.AES.AES_common_s.nr alg - 1) /\ va_get_reg64 rR13 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.hi64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ va_get_reg64 rR12 va_sM == Vale.Def.Types_s.reverse_bytes_nat64 (Vale.Arch.Types.lo64 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 0) (va_get_mem_heaplet 6 va_sM))) /\ (let rk = FStar.Seq.Base.index #quad32 round_keys (Vale.AES.AES_common_s.nr alg) in (va_get_xmm 2 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, va_get_xmm 7 va_sM, va_get_xmm 3 va_sM) == make_six_of #quad32 (fun (i:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor rk (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM))) /\ Vale.X64.Decls.buffer128_read scratch_b 8 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 5) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 3 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 4) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 4 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 3) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 5 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 2) (va_get_mem_heaplet 6 va_s0)) /\ Vale.X64.Decls.buffer128_read scratch_b 6 (va_get_mem_heaplet 3 va_sM) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.X64.Decls.buffer128_read in0_b (in0_count `op_Multiply` 6 + 1) (va_get_mem_heaplet 6 va_s0)) /\ init == make_six_of #quad32 (fun (n:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE n)) (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0)) /\ (let eventual_Xi = add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM)) in eventual_Xi == Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GHash.ghash_incremental h_LE y_prev data))))) ==> va_k va_sM ((init)))) val va_wpProof_Loop6x_partial : alg:algorithm -> h_LE:quad32 -> y_prev:quad32 -> data:(seq quad32) -> count:nat -> in0_count:nat -> iv_b:buffer128 -> in0_b:buffer128 -> in_b:buffer128 -> scratch_b:buffer128 -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> hkeys_b:buffer128 -> ctr_BE:quad32 -> va_s0:va_state -> va_k:(va_state -> quad32_6 -> Type0) -> Ghost (va_state & va_fuel & quad32_6) (requires (va_t_require va_s0 /\ va_wp_Loop6x_partial alg h_LE y_prev data count in0_count iv_b in0_b in_b scratch_b key_words round_keys keys_b hkeys_b ctr_BE va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Loop6x_partial alg) ([va_Mod_flags; va_Mod_mem_heaplet 3; va_Mod_mem_heaplet 2; va_Mod_xmm 15; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_xmm 8; va_Mod_xmm 7; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR13; va_Mod_reg64 rR12; va_Mod_reg64 rR11; va_Mod_reg64 rRbx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@ "opaque_to_smt" va_qattr] let va_quick_Loop6x_partial (alg:algorithm) (h_LE:quad32) (y_prev:quad32) (data:(seq quad32)) (count:nat) (in0_count:nat) (iv_b:buffer128) (in0_b:buffer128) (in_b:buffer128) (scratch_b:buffer128) (key_words:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (hkeys_b:buffer128) (ctr_BE:quad32) : (va_quickCode quad32_6 (va_code_Loop6x_partial alg)) = (va_QProc (va_code_Loop6x_partial alg) ([va_Mod_flags; va_Mod_mem_heaplet 3; va_Mod_mem_heaplet 2; va_Mod_xmm 15; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 11; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_xmm 8; va_Mod_xmm 7; va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_xmm 0; va_Mod_reg64 rR13; va_Mod_reg64 rR12; va_Mod_reg64 rR11; va_Mod_reg64 rRbx; va_Mod_mem]) (va_wp_Loop6x_partial alg h_LE y_prev data count in0_count iv_b in0_b in_b scratch_b key_words round_keys keys_b hkeys_b ctr_BE) (va_wpProof_Loop6x_partial alg h_LE y_prev data count in0_count iv_b in0_b in_b scratch_b key_words round_keys keys_b hkeys_b ctr_BE)) //-- #reset-options "--z3rlimit 50" //-- Loop6x val va_code_Loop6x : alg:algorithm -> Tot va_code val va_codegen_success_Loop6x : alg:algorithm -> Tot va_pbool val va_lemma_Loop6x : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> h_LE:quad32 -> y_orig:quad32 -> y_prev:quad32 -> count:nat -> iv_b:buffer128 -> in0_b:buffer128 -> in_b:buffer128 -> out_b:buffer128 -> scratch_b:buffer128 -> plain_quads:(seq quad32) -> key_words:(seq nat32) -> round_keys:(seq quad32) -> keys_b:buffer128 -> hkeys_b:buffer128 -> ctr_BE_orig:quad32 -> ctr_BE:quad32 -> Ghost (va_state & va_fuel & quad32) (requires (va_require_total va_b0 (va_code_Loop6x alg) va_s0 /\ va_get_ok va_s0 /\ (sse_enabled /\ movbe_enabled /\ count >= 2 /\ va_get_reg64 rRdx va_s0 >= 6 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b ((count - 1) `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRsi va_s0) out_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR9 va_s0 - 32) hkeys_b 8 (va_get_mem_layout va_s0) Secret /\ Vale.AES.GCTR.partial_seq_agreement plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in_b) (count `op_Multiply` 6) (count `op_Multiply` 6 + 6) /\ (Vale.X64.Decls.buffers_disjoint128 in_b out_b \/ in_b == out_b) /\ in0_b == out_b /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ va_get_reg64 rR14 va_s0 + 96 < pow2_64 /\ va_get_reg64 rRsi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ pclmulqdq_enabled /\ h_LE == Vale.AES.AES_s.aes_encrypt_LE alg key_words (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0) /\ Vale.AES.GHash.hkeys_reqs_priv (Vale.X64.Decls.s128 (va_get_mem_heaplet 0 va_s0) hkeys_b) (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) /\ scratch_reqs scratch_b (count - 2) (va_get_mem_heaplet 3 va_s0) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_s0) /\ y_prev == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) 0 ((count - 2) `op_Multiply` 6)) /\ y_prev == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))))) /\ count `op_Multiply` 6 + 6 < pow2_32 /\ ctr_BE == Vale.AES.GCTR.inc32lite ctr_BE_orig (count `op_Multiply` 6) /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` count) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) out_b) key_words ctr_BE_orig))) (ensures (fun (va_sM, va_fM, y_new) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ ((va_get_reg64 rRdx va_sM > 0 ==> Vale.X64.Decls.modifies_buffer_specific128 out_b (va_get_mem_heaplet 6 va_s0) (va_get_mem_heaplet 6 va_sM) (count `op_Multiply` 6 + 0) (count `op_Multiply` 6 + 5)) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_mem_heaplet 6 va_sM == va_get_mem_heaplet 6 va_s0) /\ Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 6 /\ va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0 + 96 /\ va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 + 96 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 + 96 /\ va_get_xmm 15 va_sM == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ (let z3' = (if (va_get_reg64 rRdx va_sM = 0) then va_get_xmm 7 va_sM else Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10)) in (va_get_reg64 rRbx va_sM + 6 < 256 ==> (va_get_xmm 1 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, z3', va_get_xmm 3 va_sM) == xor_reverse_inc32lite_6 0 6 ctr_BE (va_get_xmm 15 va_sM)) /\ va_get_reg64 rRbx va_sM == Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6) `op_Modulus` 256 /\ (va_get_reg64 rRdx va_sM == 0 ==> Vale.AES.GCTR.gctr_registers (va_get_xmm 9 va_sM) (va_get_xmm 10 va_sM) (va_get_xmm 11 va_sM) (va_get_xmm 12 va_sM) (va_get_xmm 13 va_sM) (va_get_xmm 14 va_sM) plain_quads alg key_words ctr_BE_orig count) /\ (let inout4' = (if (va_get_reg64 rRbx va_sM + 6 < 256) then Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10) else va_get_xmm 13 va_sM) in (va_get_reg64 rRdx va_sM > 0 ==> (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == (Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6)) (va_get_xmm 15 va_sM), va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, inout4', va_get_xmm 3 va_sM)) /\ (va_get_reg64 rRdx va_sM > 0 ==> make_six_of #Vale.X64.Decls.quad32 (fun (i:(va_int_range 0 5)) -> Vale.X64.Decls.buffer128_read out_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM)) == make_six_of #Vale.X64.Decls.quad32 (fun (i:(va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_s0)) (Vale.AES.GCTR.aes_encrypt_BE alg key_words (Vale.AES.GCTR.inc32lite ctr_BE i)))) /\ (va_get_reg64 rRdx va_sM > 0 ==> Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` (count + 1)) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) out_b) key_words ctr_BE_orig) /\ y_new == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) in0_b) 0 ((count - 1) `op_Multiply` 6)) /\ (va_get_reg64 rRdx va_sM > 0 ==> y_new == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))))) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_xmm 8 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 y_new) /\ (va_get_reg64 rRdx va_sM > 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_sM)) /\ (va_get_reg64 rRdx va_sM == 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM)))))) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 3 va_sM (va_update_mem_heaplet 2 va_sM (va_update_mem_heaplet 6 va_sM (va_update_xmm 15 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM (va_update_xmm 11 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_xmm 8 va_sM (va_update_xmm 7 va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_xmm 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR12 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdi 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.InsVector.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.InsAes.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Transformers.Transform.fsti.checked", "Vale.Math.Poly2_s.fsti.checked", "Vale.Math.Poly2.Bits_s.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Prop_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.AES.X64.PolyOps.fsti.checked", "Vale.AES.X64.AESopt2.fsti.checked", "Vale.AES.X64.AESGCM_expected_code.fsti.checked", "Vale.AES.GHash.fsti.checked", "Vale.AES.GF128_s.fsti.checked", "Vale.AES.GF128.fsti.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_helpers.fsti.checked", "Vale.AES.AES_s.fst.checked", "Vale.AES.AES_helpers.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": false, "source_file": "Vale.AES.X64.AESopt.fsti" }
[ { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Transformers.Transform", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AESGCM_expected_code", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AESopt2", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.PolyOps", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GF128", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GF128_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.TypesNative", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_helpers", "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.InsAes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "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.AES.AES_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": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Transformers.Transform", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AESGCM_expected_code", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.AESopt2", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64.PolyOps", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GF128", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GF128_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Math.Poly2_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.TypesNative", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_helpers", "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.InsAes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsVector", "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.AES.AES_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": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
alg: Vale.AES.AES_common_s.algorithm -> h_LE: Vale.X64.Decls.quad32 -> y_orig: Vale.X64.Decls.quad32 -> y_prev: Vale.X64.Decls.quad32 -> count: Prims.nat -> iv_b: Vale.X64.Memory.buffer128 -> in0_b: Vale.X64.Memory.buffer128 -> in_b: Vale.X64.Memory.buffer128 -> out_b: Vale.X64.Memory.buffer128 -> scratch_b: Vale.X64.Memory.buffer128 -> plain_quads: FStar.Seq.Base.seq Vale.X64.Decls.quad32 -> key_words: FStar.Seq.Base.seq Vale.X64.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.X64.Decls.quad32 -> keys_b: Vale.X64.Memory.buffer128 -> hkeys_b: Vale.X64.Memory.buffer128 -> ctr_BE_orig: Vale.X64.Decls.quad32 -> ctr_BE: Vale.X64.Decls.quad32 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Vale.X64.Decls.quad32 -> Type0) -> Type0
Prims.Tot
[ "total" ]
[]
[ "Vale.AES.AES_common_s.algorithm", "Vale.X64.Decls.quad32", "Prims.nat", "Vale.X64.Memory.buffer128", "FStar.Seq.Base.seq", "Vale.X64.Memory.nat32", "Vale.X64.Decls.va_state", "Prims.l_and", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.CPU_Features_s.sse_enabled", "Vale.X64.CPU_Features_s.movbe_enabled", "Prims.op_GreaterThanOrEqual", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Prims.eq2", "Vale.Def.Words_s.four", "Vale.Def.Types_s.nat32", "Vale.X64.Decls.va_get_xmm", "Vale.Def.Words_s.Mkfour", "Vale.X64.Decls.validDstAddrs128", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Public", "Vale.X64.Decls.validSrcAddrsOffset128", "Vale.X64.Machine_s.rR14", "Prims.op_Multiply", "Prims.op_Subtraction", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.Machine_s.rRdi", "Vale.X64.Decls.validDstAddrsOffset128", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRbp", "Vale.X64.Decls.validSrcAddrs128", "Vale.X64.Machine_s.rR9", "Vale.AES.GCTR.partial_seq_agreement", "Vale.X64.Decls.s128", "Prims.op_Addition", "Prims.l_or", "Vale.X64.Decls.buffers_disjoint128", "Prims.op_LessThan", "Vale.X64.Machine_s.pow2_64", "Vale.AES.X64.AESopt.aes_reqs_offset", "Vale.X64.Machine_s.rRcx", "FStar.Seq.Base.index", "Vale.X64.CPU_Features_s.pclmulqdq_enabled", "Vale.Def.Types_s.quad32", "Vale.AES.AES_s.aes_encrypt_LE", "Vale.AES.GHash.hkeys_reqs_priv", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.AES.X64.AESopt.scratch_reqs", "Vale.AES.GHash.ghash_incremental0", "FStar.Seq.Base.slice", "Vale.Math.Poly2.Bits_s.to_quad32", "Vale.Math.Poly2_s.add", "Vale.Math.Poly2.Bits_s.of_quad32", "Vale.X64.Decls.buffer128_read", "Vale.X64.Machine_s.pow2_32", "Vale.AES.GCTR.inc32lite", "Prims.int", "Vale.X64.Machine_s.rRbx", "Prims.op_Modulus", "Vale.Def.Words_s.__proj__Mkfour__item__lo0", "Vale.Def.Types_s.quad32_xor", "Prims.l_imp", "FStar.Pervasives.Native.tuple6", "FStar.Pervasives.Native.Mktuple6", "Vale.AES.X64.AESopt.xor_reverse_inc32lite_6", "Vale.AES.GCTR.gctr_partial", "Prims.l_Forall", "Vale.X64.InsBasic.vale_heap", "Vale.X64.Memory.nat64", "Vale.X64.Flags.t", "Prims.op_GreaterThan", "Vale.X64.Decls.modifies_buffer_specific128", "Vale.X64.Decls.vale_heap", "Vale.AES.GCTR.gctr_registers", "Vale.AES.X64.AESopt.six_of", "Vale.AES.X64.AESopt.make_six_of", "Vale.X64.Decls.va_int_range", "Vale.AES.GCTR.aes_encrypt_BE", "Vale.X64.Decls.va_if", "Prims.unit", "Prims.l_not", "Prims.op_Equality", "Vale.X64.State.vale_state", "Vale.X64.Decls.va_upd_flags", "Vale.X64.Decls.va_upd_mem_heaplet", "Vale.X64.Decls.va_upd_xmm", "Vale.X64.Decls.va_upd_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR12", "Vale.X64.Machine_s.rR11", "Vale.X64.Decls.va_upd_mem" ]
[]
false
false
false
true
true
let va_wp_Loop6x (alg: algorithm) (h_LE y_orig y_prev: quad32) (count: nat) (iv_b in0_b in_b out_b scratch_b: buffer128) (plain_quads: (seq quad32)) (key_words: (seq nat32)) (round_keys: (seq quad32)) (keys_b hkeys_b: buffer128) (ctr_BE_orig ctr_BE: quad32) (va_s0: va_state) (va_k: (va_state -> quad32 -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (sse_enabled /\ movbe_enabled /\ count >= 2 /\ va_get_reg64 rRdx va_s0 >= 6 /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 2 va_s0) (va_get_reg64 rR8 va_s0) iv_b 1 (va_get_mem_layout va_s0) Public /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rR14 va_s0) in0_b ((count - 1) `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRdi va_s0) in_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrsOffset128 (va_get_mem_heaplet 6 va_s0) (va_get_reg64 rRsi va_s0) out_b (count `op_Multiply` 6) 6 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 3 va_s0) (va_get_reg64 rRbp va_s0) scratch_b 9 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rR9 va_s0 - 32) hkeys_b 8 (va_get_mem_layout va_s0) Secret /\ Vale.AES.GCTR.partial_seq_agreement plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in_b) (count `op_Multiply` 6) (count `op_Multiply` 6 + 6) /\ (Vale.X64.Decls.buffers_disjoint128 in_b out_b \/ in_b == out_b) /\ in0_b == out_b /\ va_get_reg64 rRdi va_s0 + 96 < pow2_64 /\ va_get_reg64 rR14 va_s0 + 96 < pow2_64 /\ va_get_reg64 rRsi va_s0 + 96 < pow2_64 /\ aes_reqs_offset alg key_words round_keys keys_b (va_get_reg64 rRcx va_s0) (va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ va_get_xmm 15 va_s0 == FStar.Seq.Base.index #quad32 round_keys 0 /\ pclmulqdq_enabled /\ h_LE == Vale.AES.AES_s.aes_encrypt_LE alg key_words (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0) /\ Vale.AES.GHash.hkeys_reqs_priv (Vale.X64.Decls.s128 (va_get_mem_heaplet 0 va_s0) hkeys_b) (Vale.Def.Types_s.reverse_bytes_quad32 h_LE) /\ scratch_reqs scratch_b (count - 2) (va_get_mem_heaplet 3 va_s0) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_s0) /\ y_prev == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) 0 ((count - 2) `op_Multiply` 6)) /\ y_prev == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_s0)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_s0))))) /\ count `op_Multiply` 6 + 6 < pow2_32 /\ ctr_BE == Vale.AES.GCTR.inc32lite ctr_BE_orig (count `op_Multiply` 6) /\ va_get_xmm 2 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0) /\ va_get_reg64 rRbx va_s0 == (Vale.Def.Words_s.__proj__Mkfour__item__lo0 ctr_BE) `op_Modulus` 256 /\ va_get_xmm 9 va_s0 == Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 0)) (va_get_xmm 15 va_s0) /\ (va_get_reg64 rRbx va_s0 + 6 < 256 ==> (va_get_xmm 9 va_s0, va_get_xmm 10 va_s0, va_get_xmm 11 va_s0, va_get_xmm 12 va_s0, va_get_xmm 13 va_s0, va_get_xmm 14 va_s0) == xor_reverse_inc32lite_6 1 0 ctr_BE (va_get_xmm 15 va_s0)) /\ Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` count) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) out_b) key_words ctr_BE_orig) /\ (forall (va_x_mem: vale_heap) (va_x_rdi: nat64) (va_x_rsi: nat64) (va_x_rdx: nat64) (va_x_rbx: nat64) (va_x_r11: nat64) (va_x_r12: nat64) (va_x_r13: nat64) (va_x_r14: nat64) (va_x_xmm0: quad32) (va_x_xmm1: quad32) (va_x_xmm2: quad32) (va_x_xmm3: quad32) (va_x_xmm4: quad32) (va_x_xmm5: quad32) (va_x_xmm6: quad32) (va_x_xmm7: quad32) (va_x_xmm8: quad32) (va_x_xmm9: quad32) (va_x_xmm10: quad32) (va_x_xmm11: quad32) (va_x_xmm12: quad32) (va_x_xmm13: quad32) (va_x_xmm14: quad32) (va_x_xmm15: quad32) (va_x_heap6: vale_heap) (va_x_heap2: vale_heap) (va_x_heap3: vale_heap) (va_x_efl: Vale.X64.Flags.t) (y_new: quad32). let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 3 va_x_heap3 (va_upd_mem_heaplet 2 va_x_heap2 (va_upd_mem_heaplet 6 va_x_heap6 (va_upd_xmm 15 va_x_xmm15 (va_upd_xmm 14 va_x_xmm14 (va_upd_xmm 13 va_x_xmm13 (va_upd_xmm 12 va_x_xmm12 (va_upd_xmm 11 va_x_xmm11 (va_upd_xmm 10 va_x_xmm10 (va_upd_xmm 9 va_x_xmm9 (va_upd_xmm 8 va_x_xmm8 (va_upd_xmm 7 va_x_xmm7 (va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_xmm 0 va_x_xmm0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR12 va_x_r12 (va_upd_reg64 rR11 va_x_r11 ( va_upd_reg64 rRbx va_x_rbx ( va_upd_reg64 rRdx va_x_rdx ( va_upd_reg64 rRsi va_x_rsi ( va_upd_reg64 rRdi va_x_rdi ( va_upd_mem va_x_mem va_s0 ) ) ) ) ) )) )))))))))) ))))))))))) in va_get_ok va_sM /\ ((va_get_reg64 rRdx va_sM > 0 ==> Vale.X64.Decls.modifies_buffer_specific128 out_b (va_get_mem_heaplet 6 va_s0) (va_get_mem_heaplet 6 va_sM) (count `op_Multiply` 6 + 0) (count `op_Multiply` 6 + 5)) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_mem_heaplet 6 va_sM == va_get_mem_heaplet 6 va_s0) /\ Vale.X64.Decls.modifies_buffer_specific128 scratch_b (va_get_mem_heaplet 3 va_s0) (va_get_mem_heaplet 3 va_sM) 1 8 /\ Vale.X64.Decls.modifies_buffer_specific128 iv_b (va_get_mem_heaplet 2 va_s0) (va_get_mem_heaplet 2 va_sM) 0 0 /\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 6 /\ va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0 + 96 /\ va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 + 96 /\ va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0 + 96 /\ va_get_xmm 15 va_sM == FStar.Seq.Base.index #quad32 round_keys 0 /\ va_get_xmm 2 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 16777216 /\ va_get_xmm 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6) /\ (let z3' = va_if (va_get_reg64 rRdx va_sM = 0) (fun _ -> va_get_xmm 7 va_sM) (fun _ -> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10)) in (va_get_reg64 rRbx va_sM + 6 < 256 ==> (va_get_xmm 1 va_sM, va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, z3', va_get_xmm 3 va_sM) == xor_reverse_inc32lite_6 0 6 ctr_BE (va_get_xmm 15 va_sM)) /\ va_get_reg64 rRbx va_sM == (Vale.Def.Words_s.__proj__Mkfour__item__lo0 (Vale.AES.GCTR.inc32lite ctr_BE 6)) `op_Modulus` 256 /\ (va_get_reg64 rRdx va_sM == 0 ==> Vale.AES.GCTR.gctr_registers (va_get_xmm 9 va_sM) (va_get_xmm 10 va_sM) (va_get_xmm 11 va_sM) (va_get_xmm 12 va_sM) (va_get_xmm 13 va_sM) (va_get_xmm 14 va_sM) plain_quads alg key_words ctr_BE_orig count) /\ (let inout4' = va_if (va_get_reg64 rRbx va_sM + 6 < 256) (fun _ -> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 10)) (fun _ -> va_get_xmm 13 va_sM) in (va_get_reg64 rRdx va_sM > 0 ==> (va_get_xmm 9 va_sM, va_get_xmm 10 va_sM, va_get_xmm 11 va_sM, va_get_xmm 12 va_sM, va_get_xmm 13 va_sM, va_get_xmm 14 va_sM) == (Vale.Def.Types_s.quad32_xor (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.GCTR.inc32lite ctr_BE 6)) (va_get_xmm 15 va_sM), va_get_xmm 0 va_sM, va_get_xmm 5 va_sM, va_get_xmm 6 va_sM, inout4', va_get_xmm 3 va_sM)) /\ (va_get_reg64 rRdx va_sM > 0 ==> make_six_of #Vale.X64.Decls.quad32 (fun (i: (va_int_range 0 5)) -> Vale.X64.Decls.buffer128_read out_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_sM)) == make_six_of #Vale.X64.Decls.quad32 (fun (i: (va_int_range 0 5)) -> Vale.Def.Types_s.quad32_xor (Vale.X64.Decls.buffer128_read in_b (count `op_Multiply` 6 + i) (va_get_mem_heaplet 6 va_s0)) (Vale.AES.GCTR.aes_encrypt_BE alg key_words (Vale.AES.GCTR.inc32lite ctr_BE i) ))) /\ (va_get_reg64 rRdx va_sM > 0 ==> Vale.AES.GCTR.gctr_partial alg (6 `op_Multiply` (count + 1)) plain_quads (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) out_b) key_words ctr_BE_orig) /\ y_new == Vale.AES.GHash.ghash_incremental0 h_LE y_orig (FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_sM) in0_b) 0 ((count - 1) `op_Multiply` 6)) /\ (va_get_reg64 rRdx va_sM > 0 ==> y_new == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.Math.Poly2.Bits_s.to_quad32 (add (add (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 8 va_sM)) (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_sM))) (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read scratch_b 1 (va_get_mem_heaplet 3 va_sM)))))) /\ (va_get_reg64 rRdx va_sM == 0 ==> va_get_xmm 8 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 y_new) /\ (va_get_reg64 rRdx va_sM > 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (va_get_xmm 7 va_sM)) /\ (va_get_reg64 rRdx va_sM == 0 ==> scratch_reqs scratch_b (count - 1) (va_get_mem_heaplet 3 va_sM) (Vale.X64.Decls.s128 (va_get_mem_heaplet 6 va_s0) in0_b) (Vale.X64.Decls.buffer128_read scratch_b 2 (va_get_mem_heaplet 3 va_sM)))))) ==> va_k va_sM ((y_new))))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_qcode_KeyExpansionRoundEven256
val va_qcode_KeyExpansionRoundEven256 (va_mods: va_mods_t) (round rcon: nat8) (dst: buffer128) (key: (seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon))
val va_qcode_KeyExpansionRoundEven256 (va_mods: va_mods_t) (round rcon: nat8) (dst: buffer128) (key: (seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon))
let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 31, "end_line": 128, "start_col": 0, "start_line": 67 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> round: Vale.PPC64LE.Memory.nat8 -> rcon: Vale.PPC64LE.Memory.nat8 -> dst: Vale.PPC64LE.Memory.buffer128 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_KeyExpansionRoundEven256 round rcon)
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.buffer128", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.InsVector.va_code_Vspltisw", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.PPC64LE.InsVector.va_code_Vsbox", "Vale.PPC64LE.InsBasic.va_code_LoadImmShl64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Vale.PPC64LE.InsVector.va_code_Mtvsrws", "Vale.PPC64LE.InsVector.va_code_Vxor", "Vale.PPC64LE.InsVector.va_code_RotWord", "Vale.PPC64LE.InsVector.va_code_Vspltw", "Vale.PPC64LE.InsVector.va_code_Vsldoi", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Prims.op_Multiply", "Prims.op_Addition", "Vale.PPC64LE.InsVector.va_code_Store128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.Arch.HeapTypes_s.Secret", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.QuickCodes.va_range1", "Vale.PPC64LE.InsVector.va_quick_Vspltisw", "Vale.PPC64LE.InsVector.va_quick_Vsbox", "Vale.PPC64LE.InsBasic.va_quick_LoadImmShl64", "Vale.PPC64LE.InsVector.va_quick_Mtvsrws", "Vale.PPC64LE.InsVector.va_quick_Vxor", "Vale.PPC64LE.InsVector.va_quick_RotWord", "Vale.PPC64LE.InsVector.va_quick_Vspltw", "Vale.PPC64LE.InsVector.va_quick_Vsldoi", "Vale.PPC64LE.InsBasic.va_quick_LoadImm64", "Vale.PPC64LE.QuickCodes.va_QBind", "Vale.PPC64LE.InsVector.va_quick_Store128_byte16_buffer_index", "Vale.PPC64LE.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.eq2", "Vale.Def.Types_s.quad32", "Vale.Def.Types_s.quad32_xor", "Vale.Def.Types_s.quad32_xor_def", "Vale.Def.Types_s.quad32_xor_reveal", "Prims.int", "Vale.Def.Types_s.ishl", "Prims.op_Modulus", "Vale.AES.AES_BE_s.lemma_shl_rcon", "Vale.AES.AES256_helpers_BE.simd_round_key_256", "Vale.AES.AES256_helpers_BE.round_key_256_rcon", "Vale.AES.AES256_helpers_BE.lemma_simd_round_key", "Vale.Def.Words_s.nat32", "Prims.nat", "Vale.AES.AES_BE_s.is_aes_key_word", "Vale.AES.AES_common_s.AES_256", "Vale.AES.AES256_helpers_BE.expand_key_256", "Vale.AES.AES256_helpers_BE.expand_key_256_def", "Vale.AES.AES256_helpers_BE.expand_key_256_reveal", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.Decls.va_get_vec", "Vale.Def.Words_s.nat8", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.AES.PPC64LE.AES256.va_code_KeyExpansionRoundEven256" ]
[]
false
false
false
false
false
let va_qcode_KeyExpansionRoundEven256 (va_mods: va_mods_t) (round rcon: nat8) (dst: buffer128) (key: (seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) =
(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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3 ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1 ) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_: unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let va_arg27:Vale.Def.Types_s.nat8 = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_: unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let va_arg26:Prims.int = round + 1 in let va_arg25:Vale.Def.Types_s.nat32 = rcon in let va_arg24:Vale.Def.Types_s.quad32 = va_get_vec 3 va_old_s in let va_arg23:Vale.Def.Types_s.quad32 = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_: unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26 ) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_: unit ) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal () ) (va_QEmpty (()) )))))))) )))))))))))))))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundEven256
val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))
val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))
let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 175, "start_col": 0, "start_line": 152 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> round: Vale.PPC64LE.Memory.nat8 -> rcon: Vale.PPC64LE.Memory.nat8 -> dst: Vale.PPC64LE.Memory.buffer128 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.buffer128", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_mem_heaplet", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Vale.PPC64LE.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_KeyExpansionRoundEven256", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.PPC64LE.Decls.validDstAddrs128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.PPC64LE.Decls.buffer128_read", "Prims.op_Addition", "Vale.AES.AES256_helpers_BE.expand_key_256", "Vale.PPC64LE.Decls.modifies_buffer_specific128", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_KeyExpansionRoundEven256" ]
[]
false
false
false
false
false
let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key =
let va_mods:va_mods_t = [ va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.point64
val point64 : Type0
let point64 = lbuffer uint64 8ul
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 32, "end_line": 30, "start_col": 0, "start_line": 30 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "Lib.Buffer.lbuffer", "Lib.IntTypes.uint64", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
true
true
let point64 =
lbuffer uint64 8ul
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_wpProof_AES256EncryptRound_6way
val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound_6way (va_code_AES256EncryptRound_6way n) va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 1116, "start_col": 0, "start_line": 1105 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> init1: Vale.PPC64LE.Memory.quad32 -> init2: Vale.PPC64LE.Memory.quad32 -> init3: Vale.PPC64LE.Memory.quad32 -> init4: Vale.PPC64LE.Memory.quad32 -> init5: Vale.PPC64LE.Memory.quad32 -> init6: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Prims._assert", "Vale.PPC64LE.Decls.va_state_eq", "Vale.PPC64LE.Decls.va_update_vec", "Vale.PPC64LE.Decls.va_update_reg", "Vale.PPC64LE.Decls.va_update_ok", "Vale.PPC64LE.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Vale.AES.PPC64LE.AES256.va_lemma_AES256EncryptRound_6way", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way" ]
[]
false
false
false
false
false
let va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k =
let va_sM, va_f0 = va_lemma_AES256EncryptRound_6way (va_code_AES256EncryptRound_6way n) va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([ va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10 ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_quick_AES256EncryptRound_6way
val va_quick_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n))
val va_quick_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n))
let va_quick_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (va_QProc (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 17, "end_line": 1126, "start_col": 0, "start_line": 1119 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound_6way (va_code_AES256EncryptRound_6way n) va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> init1: Vale.PPC64LE.Memory.quad32 -> init2: Vale.PPC64LE.Memory.quad32 -> init3: Vale.PPC64LE.Memory.quad32 -> init4: Vale.PPC64LE.Memory.quad32 -> init5: Vale.PPC64LE.Memory.quad32 -> init6: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way n)
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCode.va_QProc", "Prims.unit", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Vale.AES.PPC64LE.AES256.va_wp_AES256EncryptRound_6way", "Vale.AES.PPC64LE.AES256.va_wpProof_AES256EncryptRound_6way", "Vale.PPC64LE.QuickCode.va_quickCode" ]
[]
false
false
false
false
false
let va_quick_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) =
(va_QProc (va_code_AES256EncryptRound_6way n) ([ va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10 ]) (va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer ))
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_wp_AES256EncryptRound_6way
val va_wp_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
val va_wp_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (())))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 78, "end_line": 1092, "start_col": 0, "start_line": 1068 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Vale.PPC64LE.Memory.nat8 -> init1: Vale.PPC64LE.Memory.quad32 -> init2: Vale.PPC64LE.Memory.quad32 -> init3: Vale.PPC64LE.Memory.quad32 -> init4: Vale.PPC64LE.Memory.quad32 -> init5: Vale.PPC64LE.Memory.quad32 -> init6: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Type0
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Prims.l_and", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Prims.op_LessThanOrEqual", "Prims.op_LessThan", "FStar.Seq.Base.length", "Prims.eq2", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.AES.AES_BE_s.eval_rounds_def", "Prims.op_Subtraction", "Prims.int", "Vale.PPC64LE.Decls.va_get_reg", "Vale.PPC64LE.Memory.buffer_addr", "Vale.PPC64LE.Memory.vuint128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.validSrcAddrs128", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.PPC64LE.Decls.buffer128_read", "FStar.Seq.Base.index", "Prims.l_Forall", "Vale.PPC64LE.Memory.nat64", "Prims.l_imp", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.Decls.va_upd_vec", "Vale.PPC64LE.Decls.va_upd_reg" ]
[]
false
false
false
true
true
let va_wp_AES256EncryptRound_6way (n: nat8) (init1 init2 init3 init4 init5 init6: quad32) (round_keys: (seq quad32)) (keys_buffer: buffer128) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10: nat64) (va_x_v0: quad32) (va_x_v1: quad32) (va_x_v2: quad32) (va_x_v3: quad32) (va_x_v4: quad32) (va_x_v5: quad32) (va_x_v6: quad32). let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (())))
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.point51
val point51 : Type0
let point51 = lbuffer uint64 10ul
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 33, "end_line": 28, "start_col": 0, "start_line": 28 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "Lib.Buffer.lbuffer", "Lib.IntTypes.uint64", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
true
true
let point51 =
lbuffer uint64 10ul
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_AES256EncryptRound_6way
val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))))
val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))))
let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1065, "start_col": 0, "start_line": 1040 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> n: Vale.PPC64LE.Memory.nat8 -> init1: Vale.PPC64LE.Memory.quad32 -> init2: Vale.PPC64LE.Memory.quad32 -> init3: Vale.PPC64LE.Memory.quad32 -> init4: Vale.PPC64LE.Memory.quad32 -> init5: Vale.PPC64LE.Memory.quad32 -> init6: Vale.PPC64LE.Memory.quad32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.nat8", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.AES.AES_BE_s.eval_rounds_def", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptRound_6way" ]
[]
false
false
false
false
false
let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer =
let va_mods:va_mods_t = [ va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok ] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.fget_xz
val fget_xz : h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Spec.Curve25519.elem * Spec.Curve25519.elem)
let fget_xz (#s:field_spec) (h:mem) (p:point s) = fget_x h p, fget_z h p
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 72, "end_line": 38, "start_col": 0, "start_line": 38 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *) let get_x #s (p:point s) = gsub p 0ul (nlimb s) let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s) let fget_x (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p 0ul (nlimb s))
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Spec.Curve25519.elem * Spec.Curve25519.elem)
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Curve25519.AddAndDouble.point", "FStar.Pervasives.Native.Mktuple2", "Spec.Curve25519.elem", "Hacl.Impl.Curve25519.AddAndDouble.fget_x", "Hacl.Impl.Curve25519.AddAndDouble.fget_z", "FStar.Pervasives.Native.tuple2" ]
[]
false
false
false
false
false
let fget_xz (#s: field_spec) (h: mem) (p: point s) =
fget_x h p, fget_z h p
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_AES256EncryptBlock
val va_lemma_AES256EncryptBlock : va_b0:va_code -> va_s0:va_state -> input:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptBlock ()) va_s0 /\ va_get_ok va_s0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ FStar.Seq.Base.length #quad32 round_keys == 15 /\ round_keys == Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key /\ va_get_vec 0 va_s0 == input /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < 15 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))
val va_lemma_AES256EncryptBlock : va_b0:va_code -> va_s0:va_state -> input:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptBlock ()) va_s0 /\ va_get_ok va_s0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ FStar.Seq.Base.length #quad32 round_keys == 15 /\ round_keys == Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key /\ va_get_vec 0 va_s0 == input /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ (forall (i:nat) . i < 15 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer i (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys i))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))
let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 937, "start_col": 0, "start_line": 926 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (())))))))))))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> input: Vale.PPC64LE.Memory.quad32 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.Def.Types_s.quad32", "Vale.PPC64LE.Decls.va_get_vec", "Vale.AES.AES_BE_s.aes_encrypt_word", "Vale.AES.AES_common_s.AES_256", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptBlock" ]
[]
false
false
false
false
false
let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer =
let va_mods:va_mods_t = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundUnrolledRecursive256
val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 521, "start_col": 0, "start_line": 462 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> dst: Vale.PPC64LE.Memory.buffer128 -> n: Prims.int -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[ "" ]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.Memory.buffer128", "Prims.int", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_lemma_merge_total", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.Decls.va_lemma_empty_total", "Prims.op_AmpAmp", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "Prims.unit", "Prims._assert", "Prims.l_Forall", "Prims.l_imp", "Prims.l_and", "Prims.b2t", "Prims.eq2", "Vale.Def.Types_s.quad32", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.PPC64LE.Decls.buffer128_read", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Prims.op_Equality", "Prims.op_Modulus", "Prims.list", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Vale.PPC64LE.Decls.va_tl", "Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundEven256", "Vale.PPC64LE.Decls.va_hd", "Prims.op_Subtraction", "Vale.AES.AES_common_s.aes_rcon", "Prims.op_Division", "Vale.PPC64LE.Decls.va_get_block", "Prims.bool", "Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundOdd256", "Vale.Arch.HeapImpl.vale_heap", "Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansionRoundUnrolledRecursive256", "Vale.PPC64LE.Decls.va_reveal_opaque", "Vale.AES.PPC64LE.AES256.va_code_KeyExpansionRoundUnrolledRecursive256" ]
[ "recursion" ]
false
false
false
false
false
let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n =
va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let va_old_s:va_state = va_s0 in let va_b1:va_codes = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let va_fc2, va_s2 = (if (1 < n && n <= 14) then (let va_b3 = va_get_block va_c2 in let va_s4, va_fc4 = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let old_mem:vale_heap = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let va_fc6, va_s6 = (if (n `op_Modulus` 2 = 0) then (let va_b7 = va_get_block va_c6 in let va_s8, va_fc8 = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let va_s6, va_f8 = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6)) else (let va_b9 = va_get_block va_c6 in let va_s10, va_fc10 = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let va_s6, va_f10 = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6))) in assert (forall j. {:pattern (reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))} 0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem )); let va_s2, va_f6 = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2)) else (let va_b12 = va_get_block va_c2 in let va_s2, va_fc2 = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2))) in let va_sM, va_f2 = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptBlock
val va_qcode_AES256EncryptBlock (va_mods: va_mods_t) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ()))
val va_qcode_AES256EncryptBlock (va_mods: va_mods_t) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ()))
let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (())))))))))))))))))))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 32, "end_line": 923, "start_col": 0, "start_line": 865 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ())))))))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> input: Vale.PPC64LE.Memory.quad32 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock ())
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Machine_s.Block", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Vale.PPC64LE.InsVector.va_code_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_code_Vxor", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_code_Vcipherlast", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_qAssertSquash", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Prims.op_LessThan", "FStar.Seq.Base.length", "Vale.Def.Types_s.quad32", "Prims.nat", "Prims.squash", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.InsBasic.va_quick_LoadImm64", "Vale.PPC64LE.InsVector.va_quick_Load128_byte16_buffer_index", "Vale.PPC64LE.InsVector.va_quick_Vxor", "Vale.AES.PPC64LE.AES256.va_quick_AES256EncryptRound", "Vale.PPC64LE.InsVector.va_quick_Vcipherlast", "Vale.PPC64LE.QuickCodes.va_QBind", "Vale.PPC64LE.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.eq2", "Vale.AES.AES_common_s.algorithm", "Vale.Def.Words_s.nat32", "Vale.AES.AES_BE_s.is_aes_key_word", "Vale.AES.AES_BE_s.aes_encrypt_word", "Vale.AES.AES_BE_s.aes_encrypt_word_def", "Vale.AES.AES_BE_s.aes_encrypt_word_reveal", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.Def.Types_s.quad32_xor", "FStar.Seq.Base.index", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock" ]
[]
false
false
false
false
false
let va_qcode_AES256EncryptBlock (va_mods: va_mods_t) (input: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 ( va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2 ) (va_op_vec_opr_vec 2 ) (va_op_vec_opr_vec 2 )) (fun (va_s: va_state ) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun ( _: unit ) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal () ) (va_QEmpty ( () ) )) )))))))))))) ))))))))))
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_gsub_len
val table_gsub_len (#bt: buftype) (#t: BD.limb_t) (len: size_t{v len > 0}) (table_len: size_t{v table_len * v len <= max_size_t}) (table: lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i: size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len)
val table_gsub_len (#bt: buftype) (#t: BD.limb_t) (len: size_t{v len > 0}) (table_len: size_t{v table_len * v len <= max_size_t}) (table: lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i: size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len)
let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 27, "end_line": 41, "start_col": 0, "start_line": 32 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> table_len: Lib.IntTypes.size_t{Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t} -> table: Lib.Buffer.lbuffer_t bt (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> Prims.GTot (Lib.Buffer.lbuffer_t bt (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len)
Prims.GTot
[ "sometrivial" ]
[]
[ "Lib.Buffer.buftype", "Hacl.Bignum.Definitions.limb_t", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Bang", "Prims.op_LessThan", "Lib.Buffer.gsub", "Prims.unit", "Hacl.Impl.PrecompTable.lemma_table_sub_len" ]
[]
false
false
false
false
false
let table_gsub_len (#bt: buftype) (#t: BD.limb_t) (len: size_t{v len > 0}) (table_len: size_t{v table_len * v len <= max_size_t}) (table: lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i: size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) =
lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_sub_len
val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r))
val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r))
let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 26, "end_line": 61, "start_col": 0, "start_line": 59 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> table_len: Lib.IntTypes.size_t{Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t} -> table: Lib.Buffer.lbuffer_t bt (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> FStar.HyperStack.ST.Stack (Lib.Buffer.lbuffer_t bt (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len)
FStar.HyperStack.ST.Stack
[]
[]
[ "Lib.Buffer.buftype", "Hacl.Bignum.Definitions.limb_t", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Bang", "Prims.op_LessThan", "Lib.Buffer.sub", "Prims.unit", "Hacl.Impl.PrecompTable.lemma_table_sub_len" ]
[]
false
true
false
false
false
let table_sub_len #t len table_len table i =
lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.spec_table_update_sub_len
val spec_table_update_sub_len (#t: BD.limb_t) (len: pos) (table_len: size_nat{table_len * len <= max_size_t}) (table: LSeq.lseq (uint_t t SEC) (table_len * len)) (i: nat{i < table_len}) (b: LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len)
val spec_table_update_sub_len (#t: BD.limb_t) (len: pos) (table_len: size_nat{table_len * len <= max_size_t}) (table: LSeq.lseq (uint_t t SEC) (table_len * len)) (i: nat{i < table_len}) (b: LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len)
let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 75, "start_col": 0, "start_line": 66 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Prims.pos -> table_len: Lib.IntTypes.size_nat{table_len * len <= Lib.IntTypes.max_size_t} -> table: Lib.Sequence.lseq (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len * len) -> i: Prims.nat{i < table_len} -> b: Lib.Sequence.lseq (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len -> Lib.Sequence.lseq (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len * len)
Prims.Tot
[ "total" ]
[]
[ "Hacl.Bignum.Definitions.limb_t", "Prims.pos", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Sequence.lseq", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.nat", "Prims.op_LessThan", "Lib.Sequence.update_sub", "Prims.unit", "Hacl.Impl.PrecompTable.lemma_table_sub_len" ]
[]
false
false
false
false
false
let spec_table_update_sub_len (#t: BD.limb_t) (len: pos) (table_len: size_nat{table_len * len <= max_size_t}) (table: LSeq.lseq (uint_t t SEC) (table_len * len)) (i: nat{i < table_len}) (b: LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) =
lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_wpProof_AES256EncryptBlock_6way
val va_wpProof_AES256EncryptBlock_6way : in1:quad32 -> in2:quad32 -> in3:quad32 -> in4:quad32 -> in5:quad32 -> in6:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptBlock_6way in1 in2 in3 in4 in5 in6 key round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptBlock_6way ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_AES256EncryptBlock_6way : in1:quad32 -> in2:quad32 -> in3:quad32 -> in4:quad32 -> in5:quad32 -> in6:quad32 -> key:(seq nat32) -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptBlock_6way in1 in2 in3 in4 in5 in6 key round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptBlock_6way ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_AES256EncryptBlock_6way in1 in2 in3 in4 in5 in6 key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock_6way (va_code_AES256EncryptBlock_6way ()) va_s0 in1 in2 in3 in4 in5 in6 key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 1374, "start_col": 0, "start_line": 1363 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound_6way (va_code_AES256EncryptRound_6way n) va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (va_QProc (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer)) //-- //-- AES256EncryptBlock_6way [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock_6way () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CCons (va_code_AES256EncryptRound_6way 1) (va_CCons (va_code_AES256EncryptRound_6way 2) (va_CCons (va_code_AES256EncryptRound_6way 3) (va_CCons (va_code_AES256EncryptRound_6way 4) (va_CCons (va_code_AES256EncryptRound_6way 5) (va_CCons (va_code_AES256EncryptRound_6way 6) (va_CCons (va_code_AES256EncryptRound_6way 7) (va_CCons (va_code_AES256EncryptRound_6way 8) (va_CCons (va_code_AES256EncryptRound_6way 9) (va_CCons (va_code_AES256EncryptRound_6way 10) (va_CCons (va_code_AES256EncryptRound_6way 11) (va_CCons (va_code_AES256EncryptRound_6way 12) (va_CCons (va_code_AES256EncryptRound_6way 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))))))))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock_6way () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 1) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 2) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 3) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 4) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 5) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 6) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 7) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 8) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 9) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 10) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 11) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 12) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock_6way (va_mods:va_mods_t) (in1:quad32) (in2:quad32) (in3:quad32) (in4:quad32) (in5:quad32) (in6:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock_6way ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 370 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init1:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in1 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 371 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init2:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in2 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 372 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init3:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in3 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 373 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init4:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in4 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 374 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init5:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in5 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 375 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init6:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in6 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 377 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 378 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 379 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 380 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 381 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 382 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 383 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 384 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 385 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 1 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 386 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 2 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 387 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 3 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 388 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 4 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 389 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 5 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 390 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 6 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 391 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 7 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 392 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 8 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 393 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 9 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 394 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 10 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 11 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 12 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 13 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 403 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 404 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 405 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 408 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 409 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock_6way va_b0 va_s0 in1 in2 in3 in4 in5 in6 key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock_6way va_mods in1 in2 in3 in4 in5 in6 key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock_6way ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 333 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 363 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in2) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in3) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 366 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in4) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 367 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in5) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 368 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key in6)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
in1: Vale.PPC64LE.Memory.quad32 -> in2: Vale.PPC64LE.Memory.quad32 -> in3: Vale.PPC64LE.Memory.quad32 -> in4: Vale.PPC64LE.Memory.quad32 -> in5: Vale.PPC64LE.Memory.quad32 -> in6: Vale.PPC64LE.Memory.quad32 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> va_s0: Vale.PPC64LE.Decls.va_state -> va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.Decls.va_state", "Prims.unit", "Vale.PPC64LE.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Prims.Nil", "Prims._assert", "Vale.PPC64LE.Decls.va_state_eq", "Vale.PPC64LE.Decls.va_update_vec", "Vale.PPC64LE.Decls.va_update_reg", "Vale.PPC64LE.Decls.va_update_ok", "Vale.PPC64LE.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.PPC64LE.Machine_s.state", "Vale.AES.PPC64LE.AES256.va_lemma_AES256EncryptBlock_6way", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock_6way" ]
[]
false
false
false
false
false
let va_wpProof_AES256EncryptBlock_6way in1 in2 in3 in4 in5 in6 key round_keys keys_buffer va_s0 va_k =
let va_sM, va_f0 = va_lemma_AES256EncryptBlock_6way (va_code_AES256EncryptBlock_6way ()) va_s0 in1 in2 in3 in4 in5 in6 key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([ va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10 ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_update_sub_len
val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b))
val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b))
let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 35, "end_line": 95, "start_col": 0, "start_line": 93 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> table_len: Lib.IntTypes.size_t{Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t} -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> b: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Bignum.Definitions.limb_t", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Bang", "Prims.op_LessThan", "Lib.Buffer.update_sub", "Lib.Buffer.MUT", "Prims.unit", "Hacl.Impl.PrecompTable.lemma_table_sub_len" ]
[]
false
true
false
false
false
let table_update_sub_len #t len table_len table i b =
lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_select_consttime_f
val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc))
val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc))
let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 44, "end_line": 118, "start_col": 0, "start_line": 115 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t } -> table: Lib.Buffer.clbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.uint_t t Lib.IntTypes.SEC {Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> j: Lib.IntTypes.size_t{Lib.IntTypes.v j < Lib.IntTypes.v table_len - 1} -> acc: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Bignum.Definitions.limb_t", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.clbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Bang", "Prims.op_Subtraction", "Lib.Buffer.lbuffer", "Lib.Buffer.map2T", "Lib.Buffer.CONST", "Lib.Buffer.MUT", "Hacl.Spec.Bignum.Base.mask_select", "Prims.unit", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Hacl.Impl.PrecompTable.table_sub_len", "Lib.IntTypes.op_Plus_Bang", "FStar.UInt32.__uint_to_t", "Lib.IntTypes.eq_mask", "Hacl.Spec.Bignum.Base.size_to_limb" ]
[]
false
true
false
false
false
let table_select_consttime_f #t len table_len table i j acc =
let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_get_vartime
val lprecomp_get_vartime: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> lprecomp_get_st a_t len ctx_len k
val lprecomp_get_vartime: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> lprecomp_get_st a_t len ctx_len k
let lprecomp_get_vartime #a_t len ctx_len k a table_len table bits_l tmp = let bits_l32 = Lib.RawIntTypes.(size_from_UInt32 (u32_to_UInt32 (to_u32 bits_l))) in assert (v bits_l32 == v bits_l /\ v bits_l < v table_len); let h0 = ST.get () in let a_bits_l = table_sub_len len table_len table bits_l32 in let h1 = ST.get () in assert (precomp_table_inv len ctx_len k a table_len (as_seq h0 table) (v bits_l)); assert (k.to.refl (as_seq h1 a_bits_l) == S.pow k.to.comm_monoid (k.to.refl a) (v bits_l)); copy tmp a_bits_l
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 19, "end_line": 502, "start_col": 0, "start_line": 493 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp inline_for_extraction noextract val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp = lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp inline_for_extraction noextract val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j)) let lprecomp_table_noalloc #a_t len ctx_len k ctx a table_len table tmp = let t0 = sub table 0ul len in let t1 = sub table len len in k.lone ctx t0; let h0 = ST.get () in copy t1 a; let h1 = ST.get () in //B.modifies_buffer_elim (B.gsub #(uint_t a_t SEC) table 0ul len) (loc t1) h0 h1; LSeq.eq_intro (as_seq h0 t0) (as_seq h1 t0); assert (k.to.linv (as_seq h1 t0) /\ k.to.linv (as_seq h1 t1)); S.lemma_pow0 k.to.comm_monoid (k.to.refl (as_seq h0 a)); S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 0); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 1); [@ inline_let] let inv h (i:nat{i <= (v table_len - 2) / 2}) = modifies (loc table |+| loc tmp) h1 h /\ (forall (j:nat{j < 2 * i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j) in [@inline_let] let nb = (table_len -! 2ul) /. 2ul in Lib.Loops.for 0ul nb inv (fun j -> lprecomp_table_f len ctx_len k ctx a table_len j table tmp) let lprecomp_table #a_t len ctx_len k ctx a table_len table = push_frame (); let tmp = create len (uint #a_t #SEC 0) in lprecomp_table_noalloc len ctx_len k ctx a table_len table tmp; pop_frame () //----------------
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> Hacl.Impl.PrecompTable.lprecomp_get_st a_t len ctx_len k
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "FStar.Ghost.erased", "Lib.Sequence.lseq", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.clbuffer", "Lib.IntTypes.op_Star_Bang", "Lib.Buffer.lbuffer", "Lib.Buffer.copy", "Lib.Buffer.CONST", "Prims.unit", "Prims._assert", "Prims.eq2", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__a_spec", "FStar.Ghost.reveal", "Hacl.Impl.Exponentiation.Definitions.to_comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__to", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__refl", "Lib.Buffer.as_seq", "Lib.Exponentiation.Definition.pow", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__comm_monoid", "Hacl.Impl.PrecompTable.precomp_table_inv", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Hacl.Impl.PrecompTable.table_sub_len", "Prims.int", "Prims.l_or", "Lib.IntTypes.range", "Prims.op_Equality", "FStar.UInt.size", "FStar.UInt32.v", "Lib.RawIntTypes.u32_to_UInt32", "Lib.IntTypes.to_u32", "Lib.RawIntTypes.size_from_UInt32" ]
[]
false
false
false
false
false
let lprecomp_get_vartime #a_t len ctx_len k a table_len table bits_l tmp =
let bits_l32 = let open Lib.RawIntTypes in size_from_UInt32 (u32_to_UInt32 (to_u32 bits_l)) in assert (v bits_l32 == v bits_l /\ v bits_l < v table_len); let h0 = ST.get () in let a_bits_l = table_sub_len len table_len table bits_l32 in let h1 = ST.get () in assert (precomp_table_inv len ctx_len k a table_len (as_seq h0 table) (v bits_l)); assert (k.to.refl (as_seq h1 a_bits_l) == S.pow k.to.comm_monoid (k.to.refl a) (v bits_l)); copy tmp a_bits_l
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_select_consttime
val table_select_consttime: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> res:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h res /\ disjoint table res) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ as_seq h1 res == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i))
val table_select_consttime: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> res:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h res /\ disjoint table res) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ as_seq h1 res == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i))
let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 65, "end_line": 142, "start_col": 0, "start_line": 121 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t } -> table: Lib.Buffer.clbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.uint_t t Lib.IntTypes.SEC {Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> res: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Bignum.Definitions.limb_t", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.clbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Bang", "Lib.Buffer.lbuffer", "Hacl.Spec.PrecompTable.table_select_lemma", "Lib.Buffer.as_seq", "Lib.Buffer.CONST", "Prims.unit", "Lib.Loops.for", "FStar.UInt32.__uint_to_t", "Lib.IntTypes.op_Subtraction_Bang", "Hacl.Impl.PrecompTable.table_select_consttime_f", "Lib.LoopCombinators.unfold_repeati", "Lib.Sequence.lseq", "Prims.op_Addition", "Hacl.Spec.PrecompTable.table_select_f", "Lib.Buffer.MUT", "Lib.LoopCombinators.eq_repeati0", "Prims.op_Subtraction", "FStar.Monotonic.HyperStack.mem", "Prims.nat", "Prims.logical", "Lib.Buffer.modifies", "Lib.Buffer.loc", "Prims.eq2", "Lib.LoopCombinators.repeati", "Prims._assert", "Lib.Sequence.sub", "FStar.HyperStack.ST.get", "Lib.Buffer.copy", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Hacl.Impl.PrecompTable.table_sub_len" ]
[]
false
true
false
false
false
let table_select_consttime #t len table_len table i res =
let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@@ inline_let ]let inv h (j: nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_sqr
val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2))
val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2))
let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1)
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 80, "end_line": 210, "start_col": 0, "start_line": 204 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> i: Lib.IntTypes.size_t -> ti: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> res: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.Exponentiation.Definition.lemma_pow_add", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__a_spec", "FStar.Ghost.reveal", "Hacl.Impl.Exponentiation.Definitions.to_comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__to", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__refl", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Prims.op_Addition", "Prims.unit", "Prims._assert", "Prims.eq2", "Lib.Exponentiation.Definition.__proj__Mkcomm_monoid__item__mul", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__lsqr" ]
[]
false
true
false
false
false
let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res =
let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1)
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_get_consttime
val lprecomp_get_consttime: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> lprecomp_get_st a_t len ctx_len k
val lprecomp_get_consttime: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> lprecomp_get_st a_t len ctx_len k
let lprecomp_get_consttime #a_t len ctx_len k a table_len table bits_l tmp = let h0 = ST.get () in table_select_consttime len table_len table bits_l tmp; let h1 = ST.get () in assert (precomp_table_inv len ctx_len k a table_len (as_seq h0 table) (v bits_l)); assert (k.to.refl (as_seq h1 tmp) == S.pow k.to.comm_monoid (k.to.refl a) (v bits_l))
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 87, "end_line": 510, "start_col": 0, "start_line": 505 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp inline_for_extraction noextract val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp = lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp inline_for_extraction noextract val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j)) let lprecomp_table_noalloc #a_t len ctx_len k ctx a table_len table tmp = let t0 = sub table 0ul len in let t1 = sub table len len in k.lone ctx t0; let h0 = ST.get () in copy t1 a; let h1 = ST.get () in //B.modifies_buffer_elim (B.gsub #(uint_t a_t SEC) table 0ul len) (loc t1) h0 h1; LSeq.eq_intro (as_seq h0 t0) (as_seq h1 t0); assert (k.to.linv (as_seq h1 t0) /\ k.to.linv (as_seq h1 t1)); S.lemma_pow0 k.to.comm_monoid (k.to.refl (as_seq h0 a)); S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 0); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 1); [@ inline_let] let inv h (i:nat{i <= (v table_len - 2) / 2}) = modifies (loc table |+| loc tmp) h1 h /\ (forall (j:nat{j < 2 * i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j) in [@inline_let] let nb = (table_len -! 2ul) /. 2ul in Lib.Loops.for 0ul nb inv (fun j -> lprecomp_table_f len ctx_len k ctx a table_len j table tmp) let lprecomp_table #a_t len ctx_len k ctx a table_len table = push_frame (); let tmp = create len (uint #a_t #SEC 0) in lprecomp_table_noalloc len ctx_len k ctx a table_len table tmp; pop_frame () //---------------- let lprecomp_get_vartime #a_t len ctx_len k a table_len table bits_l tmp = let bits_l32 = Lib.RawIntTypes.(size_from_UInt32 (u32_to_UInt32 (to_u32 bits_l))) in assert (v bits_l32 == v bits_l /\ v bits_l < v table_len); let h0 = ST.get () in let a_bits_l = table_sub_len len table_len table bits_l32 in let h1 = ST.get () in assert (precomp_table_inv len ctx_len k a table_len (as_seq h0 table) (v bits_l)); assert (k.to.refl (as_seq h1 a_bits_l) == S.pow k.to.comm_monoid (k.to.refl a) (v bits_l)); copy tmp a_bits_l
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> Hacl.Impl.PrecompTable.lprecomp_get_st a_t len ctx_len k
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "FStar.Ghost.erased", "Lib.Sequence.lseq", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Lib.Buffer.clbuffer", "Lib.IntTypes.op_Star_Bang", "Lib.Buffer.lbuffer", "Prims._assert", "Prims.eq2", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__a_spec", "FStar.Ghost.reveal", "Hacl.Impl.Exponentiation.Definitions.to_comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__to", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__refl", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Lib.Exponentiation.Definition.pow", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__comm_monoid", "Prims.unit", "Hacl.Impl.PrecompTable.precomp_table_inv", "Lib.Buffer.CONST", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Hacl.Impl.PrecompTable.table_select_consttime" ]
[]
false
false
false
false
false
let lprecomp_get_consttime #a_t len ctx_len k a table_len table bits_l tmp =
let h0 = ST.get () in table_select_consttime len table_len table bits_l tmp; let h1 = ST.get () in assert (precomp_table_inv len ctx_len k a table_len (as_seq h0 table) (v bits_l)); assert (k.to.refl (as_seq h1 tmp) == S.pow k.to.comm_monoid (k.to.refl a) (v bits_l))
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_mul
val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3))
val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3))
let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a))
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 57, "end_line": 178, "start_col": 0, "start_line": 170 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> i: Lib.IntTypes.size_t -> ti: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> res: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Lib.Exponentiation.Definition.lemma_pow1", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__a_spec", "FStar.Ghost.reveal", "Hacl.Impl.Exponentiation.Definitions.to_comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__to", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__refl", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Prims.unit", "Lib.Exponentiation.Definition.lemma_pow_add", "Prims.op_Addition", "FStar.Mul.op_Star", "Lib.Exponentiation.Definition.__proj__Mkcomm_monoid__item__lemma_mul_comm", "Prims._assert", "Prims.eq2", "Lib.Exponentiation.Definition.__proj__Mkcomm_monoid__item__mul", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__lmul" ]
[]
false
true
false
false
false
let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res =
let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a))
false
Vale.AsLowStar.MemoryHelpers.fsti
Vale.AsLowStar.MemoryHelpers.imm_low_buffer_read
val imm_low_buffer_read (src t: base_typ) (h: HS.mem) (b: (ibuf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t)
val imm_low_buffer_read (src t: base_typ) (h: HS.mem) (b: (ibuf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t)
let imm_low_buffer_read (src t:base_typ) (h:HS.mem) (b:(ibuf_t src t){B.live h b}) (i:nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t) = let view = LSig.view_of_base_typ t in let db = get_downview b in DV.length_eq db; let b_v = UV.mk_buffer db view in UV.length_eq b_v; UV.sel h b_v i
{ "file_name": "vale/code/arch/x64/interop/Vale.AsLowStar.MemoryHelpers.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 230, "start_col": 0, "start_line": 224 }
module Vale.AsLowStar.MemoryHelpers open Vale.X64.MemoryAdapters open Vale.Interop.Base module B = LowStar.Buffer module BS = Vale.X64.Machine_Semantics_s module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up module HS = FStar.HyperStack module ME = Vale.X64.Memory module MES = Vale.X64.Memory_Sems module SI = Vale.X64.Stack_i module VSS = Vale.X64.Stack_Sems module MS = Vale.X64.Machine_s module IA = Vale.Interop.Assumptions module V = Vale.X64.Decls module VS = Vale.X64.State module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module SL = Vale.X64.StateLemmas module VL = Vale.X64.Lemmas module ST = FStar.HyperStack.ST module I = Vale.Interop open Vale.Arch.Heap open Vale.Arch.HeapImpl open FStar.Mul val as_vale_buffer_len (#src #t:base_typ) (x:buf_t src t) : Lemma (V.buffer_length (as_vale_buffer x) == (B.length x * view_n src) / view_n t) [SMTPat (V.buffer_length (as_vale_buffer x))] val as_vale_immbuffer_len (#src #t:base_typ) (x:ibuf_t src t) : Lemma (V.buffer_length (as_vale_immbuffer x) == (B.length x * view_n src) / view_n t) [SMTPat (V.buffer_length (as_vale_immbuffer x))] val state_eq_down_mem (va_s1:V.va_state) (s1:BS.machine_state) : Lemma (requires VL.state_eq_opt true (Some (SL.state_to_S va_s1)) (Some s1)) (ensures ( heap_create_machine (as_mem va_s1.VS.vs_heap.vf_heap) == heap_get s1.BS.ms_heap)) val relate_modifies (args:list arg) (m0 m1:ME.vale_full_heap) : Lemma (requires ME.modifies (VSig.mloc_modified_args args) (ME.get_vale_heap m0) (ME.get_vale_heap m1)) (ensures B.modifies (loc_modified_args args) (hs_of_mem (as_mem m0.vf_heap)) (hs_of_mem (as_mem m1.vf_heap))) val reveal_readable (#src #t:base_typ) (x:buf_t src t) (h:ME.vale_heap) : Lemma ( List.memP (mut_to_b8 src x) (ptrs_of_mem (as_mem h)) <==> ME.buffer_readable h (as_vale_buffer x) ) val reveal_imm_readable (#src #t:base_typ) (x:ibuf_t src t) (h:ME.vale_heap) : Lemma ( List.memP (imm_to_b8 src x) (ptrs_of_mem (as_mem h)) <==> ME.buffer_readable h (as_vale_immbuffer x) ) val readable_live (#src #t:base_typ) (x:buf_t src t) (h:ME.vale_heap) : Lemma ( ME.buffer_readable h (as_vale_buffer x) ==> B.live (hs_of_mem (as_mem h)) x) val readable_imm_live (#src #t:base_typ) (x:ibuf_t src t) (h:ME.vale_heap) : Lemma ( ME.buffer_readable h (as_vale_immbuffer x) ==> B.live (hs_of_mem (as_mem h)) x) val buffer_readable_reveal (#max_arity:nat) (src bt:base_typ) (x:buf_t src bt) (args:IX64.arity_ok max_arity arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma ( let mem = mk_mem args h0 in ME.buffer_readable (create_initial_vale_heap mem) (as_vale_buffer x) <==> List.memP (mut_to_b8 src x) (ptrs_of_mem mem)) val lemma_as_mem_as_vale_mem (h:interop_heap) : Lemma (ensures as_mem (create_initial_vale_heap h) == h) [SMTPat (as_mem (create_initial_vale_heap h))] val mk_stack_reveal (stack:BS.machine_stack) : Lemma (VSS.stack_to_s (as_vale_stack stack) == stack /\ SI.init_rsp (as_vale_stack stack) == stack.BS.initial_rsp) val buffer_as_seq_reveal (src t:ME.base_typ) (x:buf_t src t) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let y = as_vale_buffer x in let db = get_downview x in DV.length_eq db; let mem = mk_mem args h0 in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (create_initial_vale_heap mem) y)) (UV.as_seq h0 (UV.mk_buffer db (LSig.view_of_base_typ t)))) val immbuffer_as_seq_reveal (src t:ME.base_typ) (x:ibuf_t src t) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let y = as_vale_immbuffer x in let db = get_downview x in DV.length_eq db; let mem = mk_mem args h0 in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (create_initial_vale_heap mem) y)) (UV.as_seq h0 (UV.mk_buffer db (LSig.view_of_base_typ t)))) val buffer_as_seq_reveal2 (src t:ME.base_typ) (x:buf_t src t) (va_s:V.va_state) : Lemma (let y = as_vale_buffer x in let db = get_downview x in DV.length_eq db; let h = hs_of_mem (as_mem va_s.VS.vs_heap.vf_heap) in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (ME.get_vale_heap va_s.VS.vs_heap) y)) (UV.as_seq h (UV.mk_buffer db (LSig.view_of_base_typ t)))) val immbuffer_as_seq_reveal2 (src t:ME.base_typ) (x:ibuf_t src t) (va_s:V.va_state) : Lemma (let y = as_vale_immbuffer x in let db = get_downview x in DV.length_eq db; let h = hs_of_mem (as_mem va_s.VS.vs_heap.vf_heap) in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (ME.get_vale_heap va_s.VS.vs_heap) y)) (UV.as_seq h (UV.mk_buffer db (LSig.view_of_base_typ t)))) val buffer_addr_reveal (src t:ME.base_typ) (x:buf_t src t) (args:list arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let mem = mk_mem args h0 in addrs_of_mem mem (mut_to_b8 src x) == ME.buffer_addr (as_vale_buffer x) (create_initial_vale_heap mem)) val immbuffer_addr_reveal (src t:ME.base_typ) (x:ibuf_t src t) (args:list arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let mem = mk_mem args h0 in addrs_of_mem mem (imm_to_b8 src x) == ME.buffer_addr (as_vale_immbuffer x) (create_initial_vale_heap mem)) val fuel_eq : squash (V.va_fuel == nat) val decls_eval_code_reveal (c:BS.code) (va_s0 va_s1:V.va_state) (f:V.va_fuel) : Lemma (requires (V.eval_code c va_s0 f va_s1)) (ensures (VL.eval_code c va_s0 (coerce f) va_s1)) val as_vale_buffer_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:buf_t src1 t1) (y:buf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_buffer x)) (ME.loc_buffer (as_vale_buffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_buffer x)) (ME.loc_buffer (as_vale_buffer y)))] val as_vale_buffer_imm_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:ibuf_t src1 t1) (y:buf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_buffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_buffer y)))] val as_vale_immbuffer_imm_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:ibuf_t src1 t1) (y:ibuf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_immbuffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_immbuffer y)))] val modifies_same_roots (s:ME.loc) (h0 h1:ME.vale_full_heap) : Lemma (requires ME.modifies s (ME.get_vale_heap h0) (ME.get_vale_heap h1)) (ensures ptrs_of_mem (as_mem h0.vf_heap) == ptrs_of_mem (as_mem h1.vf_heap)) val modifies_equal_domains (s:ME.loc) (h0 h1:ME.vale_full_heap) : Lemma (requires ME.modifies s (ME.get_vale_heap h0) (ME.get_vale_heap h1)) (ensures FStar.HyperStack.ST.equal_domains (hs_of_mem (as_mem h0.vf_heap)) (hs_of_mem (as_mem h1.vf_heap))) val loc_disjoint_sym (x y:ME.loc) : Lemma (ME.loc_disjoint x y <==> ME.loc_disjoint y x) [SMTPat (ME.loc_disjoint x y)] val core_create_lemma_taint_hyp (#max_arity:nat) (#arg_reg:IX64.arg_reg_relation max_arity) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (ensures (let va_s = LSig.create_initial_vale_state #max_arity #arg_reg args h0 in LSig.taint_hyp args va_s)) val buffer_writeable_reveal (src t:ME.base_typ) (x:buf_t src t) : Lemma (ME.buffer_writeable (as_vale_buffer x)) let low_buffer_read (src t:base_typ) (h:HS.mem) (b:(buf_t src t){B.live h b}) (i:nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t) = let view = LSig.view_of_base_typ t in let db = get_downview b in DV.length_eq db; let b_v = UV.mk_buffer db view in UV.length_eq b_v; UV.sel h b_v i val buffer_read_reveal (src t:base_typ) (h:HS.mem) (s:ME.vale_heap) (b:(buf_t src t){B.live h b}) (i:nat{i < DV.length (get_downview b) / view_n t}) : Lemma (requires ( DV.length_eq (get_downview b); Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq s (as_vale_buffer b))) (UV.as_seq h (UV.mk_buffer (get_downview b) (LSig.view_of_base_typ t))))) (ensures LSig.nat_to_uint t (ME.buffer_read (as_vale_buffer b) i s) == low_buffer_read src t h b i ) [SMTPat (low_buffer_read src t h b i); SMTPat (ME.buffer_read (as_vale_buffer b) i s)]
{ "checked_file": "/", "dependencies": [ "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.State.fsti.checked", "Vale.X64.Stack_Sems.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory_Sems.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Lemmas.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fsti.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Vale.AsLowStar.MemoryHelpers.fsti" }
[ { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Vale.X64.Lemmas", "short_module": "VL" }, { "abbrev": true, "full_module": "Vale.X64.StateLemmas", "short_module": "SL" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.Stack_Sems", "short_module": "VSS" }, { "abbrev": true, "full_module": "Vale.X64.Stack_i", "short_module": "SI" }, { "abbrev": true, "full_module": "Vale.X64.Memory_Sems", "short_module": "MES" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "BS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": false, "full_module": "Vale.AsLowStar", "short_module": null }, { "abbrev": false, "full_module": "Vale.AsLowStar", "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
src: Vale.Arch.HeapTypes_s.base_typ -> t: Vale.Arch.HeapTypes_s.base_typ -> h: FStar.Monotonic.HyperStack.mem -> b: Vale.Interop.Base.ibuf_t src t {LowStar.Monotonic.Buffer.live h b} -> i: Prims.nat { i < LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) / Vale.Interop.Types.view_n t } -> Prims.GTot (Vale.Interop.Types.base_typ_as_type t)
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "FStar.Monotonic.HyperStack.mem", "Vale.Interop.Base.ibuf_t", "LowStar.Monotonic.Buffer.live", "Vale.Interop.Types.base_typ_as_type", "LowStar.ImmutableBuffer.immutable_preorder", "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Division", "LowStar.BufferView.Down.length", "FStar.UInt8.t", "Vale.Interop.Types.get_downview", "Vale.Interop.Types.view_n", "LowStar.BufferView.Up.sel", "Prims.unit", "LowStar.BufferView.Up.length_eq", "LowStar.BufferView.Up.buffer", "LowStar.BufferView.Up.mk_buffer", "LowStar.BufferView.Down.length_eq", "LowStar.BufferView.Down.buffer", "LowStar.BufferView.Up.view", "Vale.AsLowStar.LowStarSig.view_of_base_typ" ]
[]
false
false
false
false
false
let imm_low_buffer_read (src t: base_typ) (h: HS.mem) (b: (ibuf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t) =
let view = LSig.view_of_base_typ t in let db = get_downview b in DV.length_eq db; let b_v = UV.mk_buffer db view in UV.length_eq b_v; UV.sel h b_v i
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.point_post_add_t
val point_post_add_t:#s:field_spec -> h:mem -> f:felem s -> Type0
val point_post_add_t:#s:field_spec -> h:mem -> f:felem s -> Type0
let point_post_add_t #s h f = match s with | M51 -> F51.felem_fits h f (2, 4, 2, 2, 2) | M64 -> True
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 50, "start_col": 0, "start_line": 47 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *) let get_x #s (p:point s) = gsub p 0ul (nlimb s) let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s) let fget_x (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p 0ul (nlimb s)) let fget_z (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p (nlimb s) (nlimb s)) let fget_xz (#s:field_spec) (h:mem) (p:point s) = fget_x h p, fget_z h p val point_post_sub_t:#s:field_spec -> h:mem -> f:felem s -> Type0 let point_post_sub_t #s h f = match s with | M51 -> F51.felem_fits h f (9, 10, 9, 9, 9) | M64 -> True
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Curve25519.Fields.Core.felem s -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Curve25519.Fields.Core.felem", "Hacl.Impl.Curve25519.Field51.felem_fits", "FStar.Pervasives.Native.Mktuple5", "Prims.nat", "Prims.l_True" ]
[]
false
false
false
false
true
let point_post_add_t #s h f =
match s with | M51 -> F51.felem_fits h f (2, 4, 2, 2, 2) | M64 -> True
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.precomp_table_inv_lemma
val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j))
val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j))
let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 285, "start_col": 0, "start_line": 279 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> a: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v len) -> table_len: Lib.IntTypes.size_t{Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t} -> table1: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v table_len * Lib.IntTypes.v len) -> table2: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v table_len * Lib.IntTypes.v len) -> i: Prims.nat{i <= Lib.IntTypes.v table_len} -> FStar.Pervasives.Lemma (requires Lib.Sequence.sub table1 0 (i * Lib.IntTypes.v len) == Lib.Sequence.sub table2 0 (i * Lib.IntTypes.v len) /\ (forall (j: Prims.nat{j < i}). Hacl.Impl.PrecompTable.precomp_table_inv len ctx_len k a table_len table1 j)) (ensures forall (j: Prims.nat{j < i}). Hacl.Impl.PrecompTable.precomp_table_inv len ctx_len k a table_len table2 j)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Sequence.lseq", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.nat", "FStar.Classical.forall_intro", "Prims.op_LessThan", "Hacl.Impl.PrecompTable.precomp_table_inv", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern", "Prims._assert", "Hacl.Impl.PrecompTable.precomp_table_inv_lemma_j" ]
[]
false
false
true
false
false
let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i =
let aux (j: nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.point_post_sub_t
val point_post_sub_t:#s:field_spec -> h:mem -> f:felem s -> Type0
val point_post_sub_t:#s:field_spec -> h:mem -> f:felem s -> Type0
let point_post_sub_t #s h f = match s with | M51 -> F51.felem_fits h f (9, 10, 9, 9, 9) | M64 -> True
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 15, "end_line": 44, "start_col": 0, "start_line": 41 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *) let get_x #s (p:point s) = gsub p 0ul (nlimb s) let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s) let fget_x (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p 0ul (nlimb s)) let fget_z (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p (nlimb s) (nlimb s)) let fget_xz (#s:field_spec) (h:mem) (p:point s) = fget_x h p, fget_z h p
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Curve25519.Fields.Core.felem s -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Curve25519.Fields.Core.felem", "Hacl.Impl.Curve25519.Field51.felem_fits", "FStar.Pervasives.Native.Mktuple5", "Prims.nat", "Prims.l_True" ]
[]
false
false
false
false
true
let point_post_sub_t #s h f =
match s with | M51 -> F51.felem_fits h f (9, 10, 9, 9, 9) | M64 -> True
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.fget_z
val fget_z : h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot Spec.Curve25519.elem
let fget_z (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p (nlimb s) (nlimb s))
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 85, "end_line": 37, "start_col": 0, "start_line": 37 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *) let get_x #s (p:point s) = gsub p 0ul (nlimb s) let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot Spec.Curve25519.elem
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Curve25519.AddAndDouble.point", "Hacl.Impl.Curve25519.Fields.Core.feval", "Lib.Buffer.gsub", "Lib.Buffer.MUT", "Hacl.Impl.Curve25519.Fields.Core.limb", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Curve25519.Fields.Core.nlimb", "Spec.Curve25519.elem" ]
[]
false
false
false
false
false
let fget_z (#s: field_spec) (h: mem) (p: point s) =
feval h (gsub p (nlimb s) (nlimb s))
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.get_z
val get_z : p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Lib.Buffer.lbuffer_t Lib.Buffer.MUT (Hacl.Impl.Curve25519.Fields.Core.limb s) (Hacl.Impl.Curve25519.Fields.Core.nlimb s))
let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s)
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 53, "end_line": 34, "start_col": 0, "start_line": 34 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Lib.Buffer.lbuffer_t Lib.Buffer.MUT (Hacl.Impl.Curve25519.Fields.Core.limb s) (Hacl.Impl.Curve25519.Fields.Core.nlimb s))
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "Hacl.Impl.Curve25519.AddAndDouble.point", "Lib.Buffer.gsub", "Lib.Buffer.MUT", "Hacl.Impl.Curve25519.Fields.Core.limb", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Curve25519.Fields.Core.nlimb", "Lib.Buffer.lbuffer_t" ]
[]
false
false
false
false
false
let get_z #s (p: point s) =
gsub p (nlimb s) (nlimb s)
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.get_x
val get_x : p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Lib.Buffer.lbuffer_t Lib.Buffer.MUT (Hacl.Impl.Curve25519.Fields.Core.limb s) (Hacl.Impl.Curve25519.Fields.Core.nlimb s))
let get_x #s (p:point s) = gsub p 0ul (nlimb s)
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 33, "start_col": 0, "start_line": 33 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot (Lib.Buffer.lbuffer_t Lib.Buffer.MUT (Hacl.Impl.Curve25519.Fields.Core.limb s) (Hacl.Impl.Curve25519.Fields.Core.nlimb s))
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "Hacl.Impl.Curve25519.AddAndDouble.point", "Lib.Buffer.gsub", "Lib.Buffer.MUT", "Hacl.Impl.Curve25519.Fields.Core.limb", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Curve25519.Fields.Core.nlimb", "FStar.UInt32.__uint_to_t", "Lib.Buffer.lbuffer_t" ]
[]
false
false
false
false
false
let get_x #s (p: point s) =
gsub p 0ul (nlimb s)
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_f
val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp = lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 69, "end_line": 432, "start_col": 0, "start_line": 430 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp inline_for_extraction noextract val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < (Lib.IntTypes.v table_len - 2) / 2} -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> tmp: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Prims.op_Division", "Prims.op_Subtraction", "Lib.IntTypes.op_Star_Bang", "Hacl.Impl.PrecompTable.lprecomp_table_f_mul", "Prims.unit", "Hacl.Impl.PrecompTable.lprecomp_table_f_sqr" ]
[]
false
true
false
false
false
let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp =
lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp
false
Vale.AsLowStar.MemoryHelpers.fsti
Vale.AsLowStar.MemoryHelpers.low_buffer_read
val low_buffer_read (src t: base_typ) (h: HS.mem) (b: (buf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t)
val low_buffer_read (src t: base_typ) (h: HS.mem) (b: (buf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t)
let low_buffer_read (src t:base_typ) (h:HS.mem) (b:(buf_t src t){B.live h b}) (i:nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t) = let view = LSig.view_of_base_typ t in let db = get_downview b in DV.length_eq db; let b_v = UV.mk_buffer db view in UV.length_eq b_v; UV.sel h b_v i
{ "file_name": "vale/code/arch/x64/interop/Vale.AsLowStar.MemoryHelpers.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 212, "start_col": 0, "start_line": 206 }
module Vale.AsLowStar.MemoryHelpers open Vale.X64.MemoryAdapters open Vale.Interop.Base module B = LowStar.Buffer module BS = Vale.X64.Machine_Semantics_s module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up module HS = FStar.HyperStack module ME = Vale.X64.Memory module MES = Vale.X64.Memory_Sems module SI = Vale.X64.Stack_i module VSS = Vale.X64.Stack_Sems module MS = Vale.X64.Machine_s module IA = Vale.Interop.Assumptions module V = Vale.X64.Decls module VS = Vale.X64.State module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module SL = Vale.X64.StateLemmas module VL = Vale.X64.Lemmas module ST = FStar.HyperStack.ST module I = Vale.Interop open Vale.Arch.Heap open Vale.Arch.HeapImpl open FStar.Mul val as_vale_buffer_len (#src #t:base_typ) (x:buf_t src t) : Lemma (V.buffer_length (as_vale_buffer x) == (B.length x * view_n src) / view_n t) [SMTPat (V.buffer_length (as_vale_buffer x))] val as_vale_immbuffer_len (#src #t:base_typ) (x:ibuf_t src t) : Lemma (V.buffer_length (as_vale_immbuffer x) == (B.length x * view_n src) / view_n t) [SMTPat (V.buffer_length (as_vale_immbuffer x))] val state_eq_down_mem (va_s1:V.va_state) (s1:BS.machine_state) : Lemma (requires VL.state_eq_opt true (Some (SL.state_to_S va_s1)) (Some s1)) (ensures ( heap_create_machine (as_mem va_s1.VS.vs_heap.vf_heap) == heap_get s1.BS.ms_heap)) val relate_modifies (args:list arg) (m0 m1:ME.vale_full_heap) : Lemma (requires ME.modifies (VSig.mloc_modified_args args) (ME.get_vale_heap m0) (ME.get_vale_heap m1)) (ensures B.modifies (loc_modified_args args) (hs_of_mem (as_mem m0.vf_heap)) (hs_of_mem (as_mem m1.vf_heap))) val reveal_readable (#src #t:base_typ) (x:buf_t src t) (h:ME.vale_heap) : Lemma ( List.memP (mut_to_b8 src x) (ptrs_of_mem (as_mem h)) <==> ME.buffer_readable h (as_vale_buffer x) ) val reveal_imm_readable (#src #t:base_typ) (x:ibuf_t src t) (h:ME.vale_heap) : Lemma ( List.memP (imm_to_b8 src x) (ptrs_of_mem (as_mem h)) <==> ME.buffer_readable h (as_vale_immbuffer x) ) val readable_live (#src #t:base_typ) (x:buf_t src t) (h:ME.vale_heap) : Lemma ( ME.buffer_readable h (as_vale_buffer x) ==> B.live (hs_of_mem (as_mem h)) x) val readable_imm_live (#src #t:base_typ) (x:ibuf_t src t) (h:ME.vale_heap) : Lemma ( ME.buffer_readable h (as_vale_immbuffer x) ==> B.live (hs_of_mem (as_mem h)) x) val buffer_readable_reveal (#max_arity:nat) (src bt:base_typ) (x:buf_t src bt) (args:IX64.arity_ok max_arity arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma ( let mem = mk_mem args h0 in ME.buffer_readable (create_initial_vale_heap mem) (as_vale_buffer x) <==> List.memP (mut_to_b8 src x) (ptrs_of_mem mem)) val lemma_as_mem_as_vale_mem (h:interop_heap) : Lemma (ensures as_mem (create_initial_vale_heap h) == h) [SMTPat (as_mem (create_initial_vale_heap h))] val mk_stack_reveal (stack:BS.machine_stack) : Lemma (VSS.stack_to_s (as_vale_stack stack) == stack /\ SI.init_rsp (as_vale_stack stack) == stack.BS.initial_rsp) val buffer_as_seq_reveal (src t:ME.base_typ) (x:buf_t src t) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let y = as_vale_buffer x in let db = get_downview x in DV.length_eq db; let mem = mk_mem args h0 in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (create_initial_vale_heap mem) y)) (UV.as_seq h0 (UV.mk_buffer db (LSig.view_of_base_typ t)))) val immbuffer_as_seq_reveal (src t:ME.base_typ) (x:ibuf_t src t) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let y = as_vale_immbuffer x in let db = get_downview x in DV.length_eq db; let mem = mk_mem args h0 in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (create_initial_vale_heap mem) y)) (UV.as_seq h0 (UV.mk_buffer db (LSig.view_of_base_typ t)))) val buffer_as_seq_reveal2 (src t:ME.base_typ) (x:buf_t src t) (va_s:V.va_state) : Lemma (let y = as_vale_buffer x in let db = get_downview x in DV.length_eq db; let h = hs_of_mem (as_mem va_s.VS.vs_heap.vf_heap) in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (ME.get_vale_heap va_s.VS.vs_heap) y)) (UV.as_seq h (UV.mk_buffer db (LSig.view_of_base_typ t)))) val immbuffer_as_seq_reveal2 (src t:ME.base_typ) (x:ibuf_t src t) (va_s:V.va_state) : Lemma (let y = as_vale_immbuffer x in let db = get_downview x in DV.length_eq db; let h = hs_of_mem (as_mem va_s.VS.vs_heap.vf_heap) in Seq.equal (LSig.nat_to_uint_seq_t t (ME.buffer_as_seq (ME.get_vale_heap va_s.VS.vs_heap) y)) (UV.as_seq h (UV.mk_buffer db (LSig.view_of_base_typ t)))) val buffer_addr_reveal (src t:ME.base_typ) (x:buf_t src t) (args:list arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let mem = mk_mem args h0 in addrs_of_mem mem (mut_to_b8 src x) == ME.buffer_addr (as_vale_buffer x) (create_initial_vale_heap mem)) val immbuffer_addr_reveal (src t:ME.base_typ) (x:ibuf_t src t) (args:list arg) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (let mem = mk_mem args h0 in addrs_of_mem mem (imm_to_b8 src x) == ME.buffer_addr (as_vale_immbuffer x) (create_initial_vale_heap mem)) val fuel_eq : squash (V.va_fuel == nat) val decls_eval_code_reveal (c:BS.code) (va_s0 va_s1:V.va_state) (f:V.va_fuel) : Lemma (requires (V.eval_code c va_s0 f va_s1)) (ensures (VL.eval_code c va_s0 (coerce f) va_s1)) val as_vale_buffer_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:buf_t src1 t1) (y:buf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_buffer x)) (ME.loc_buffer (as_vale_buffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_buffer x)) (ME.loc_buffer (as_vale_buffer y)))] val as_vale_buffer_imm_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:ibuf_t src1 t1) (y:buf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_buffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_buffer y)))] val as_vale_immbuffer_imm_disjoint (#src1 #src2 #t1 #t2:base_typ) (x:ibuf_t src1 t1) (y:ibuf_t src2 t2) : Lemma (B.disjoint x y ==> ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_immbuffer y))) [SMTPat (ME.loc_disjoint (ME.loc_buffer (as_vale_immbuffer x)) (ME.loc_buffer (as_vale_immbuffer y)))] val modifies_same_roots (s:ME.loc) (h0 h1:ME.vale_full_heap) : Lemma (requires ME.modifies s (ME.get_vale_heap h0) (ME.get_vale_heap h1)) (ensures ptrs_of_mem (as_mem h0.vf_heap) == ptrs_of_mem (as_mem h1.vf_heap)) val modifies_equal_domains (s:ME.loc) (h0 h1:ME.vale_full_heap) : Lemma (requires ME.modifies s (ME.get_vale_heap h0) (ME.get_vale_heap h1)) (ensures FStar.HyperStack.ST.equal_domains (hs_of_mem (as_mem h0.vf_heap)) (hs_of_mem (as_mem h1.vf_heap))) val loc_disjoint_sym (x y:ME.loc) : Lemma (ME.loc_disjoint x y <==> ME.loc_disjoint y x) [SMTPat (ME.loc_disjoint x y)] val core_create_lemma_taint_hyp (#max_arity:nat) (#arg_reg:IX64.arg_reg_relation max_arity) (args:IX64.arg_list) (h0:HS.mem{mem_roots_p h0 args}) : Lemma (ensures (let va_s = LSig.create_initial_vale_state #max_arity #arg_reg args h0 in LSig.taint_hyp args va_s)) val buffer_writeable_reveal (src t:ME.base_typ) (x:buf_t src t) : Lemma (ME.buffer_writeable (as_vale_buffer x))
{ "checked_file": "/", "dependencies": [ "Vale.X64.StateLemmas.fsti.checked", "Vale.X64.State.fsti.checked", "Vale.X64.Stack_Sems.fsti.checked", "Vale.X64.Stack_i.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory_Sems.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_Semantics_s.fst.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Lemmas.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Interop.fsti.checked", "Vale.Def.Words_s.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "Vale.Arch.HeapImpl.fsti.checked", "Vale.Arch.Heap.fsti.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Vale.AsLowStar.MemoryHelpers.fsti" }
[ { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Heap", "short_module": null }, { "abbrev": true, "full_module": "Vale.Interop", "short_module": "I" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": true, "full_module": "Vale.X64.Lemmas", "short_module": "VL" }, { "abbrev": true, "full_module": "Vale.X64.StateLemmas", "short_module": "SL" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.Stack_Sems", "short_module": "VSS" }, { "abbrev": true, "full_module": "Vale.X64.Stack_i", "short_module": "SI" }, { "abbrev": true, "full_module": "Vale.X64.Memory_Sems", "short_module": "MES" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "Vale.X64.Machine_Semantics_s", "short_module": "BS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": false, "full_module": "Vale.AsLowStar", "short_module": null }, { "abbrev": false, "full_module": "Vale.AsLowStar", "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
src: Vale.Arch.HeapTypes_s.base_typ -> t: Vale.Arch.HeapTypes_s.base_typ -> h: FStar.Monotonic.HyperStack.mem -> b: Vale.Interop.Base.buf_t src t {LowStar.Monotonic.Buffer.live h b} -> i: Prims.nat { i < LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) / Vale.Interop.Types.view_n t } -> Prims.GTot (Vale.Interop.Types.base_typ_as_type t)
Prims.GTot
[ "sometrivial" ]
[]
[ "Vale.Arch.HeapTypes_s.base_typ", "FStar.Monotonic.HyperStack.mem", "Vale.Interop.Base.buf_t", "LowStar.Monotonic.Buffer.live", "Vale.Interop.Types.base_typ_as_type", "LowStar.Buffer.trivial_preorder", "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Division", "LowStar.BufferView.Down.length", "FStar.UInt8.t", "Vale.Interop.Types.get_downview", "Vale.Interop.Types.view_n", "LowStar.BufferView.Up.sel", "Prims.unit", "LowStar.BufferView.Up.length_eq", "LowStar.BufferView.Up.buffer", "LowStar.BufferView.Up.mk_buffer", "LowStar.BufferView.Down.length_eq", "LowStar.BufferView.Down.buffer", "LowStar.BufferView.Up.view", "Vale.AsLowStar.LowStarSig.view_of_base_typ" ]
[]
false
false
false
false
false
let low_buffer_read (src t: base_typ) (h: HS.mem) (b: (buf_t src t){B.live h b}) (i: nat{i < DV.length (get_downview b) / view_n t}) : GTot (base_typ_as_type t) =
let view = LSig.view_of_base_typ t in let db = get_downview b in DV.length_eq db; let b_v = UV.mk_buffer db view in UV.length_eq b_v; UV.sel h b_v i
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.point
val point : s: Hacl.Impl.Curve25519.Fields.Core.field_spec -> Type0
let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s)
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 64, "end_line": 24, "start_col": 0, "start_line": 24 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options"
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s: Hacl.Impl.Curve25519.Fields.Core.field_spec -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "Lib.Buffer.lbuffer", "Hacl.Impl.Curve25519.Fields.Core.limb", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Curve25519.Fields.Core.nlimb" ]
[]
false
false
false
true
true
let point (s: field_spec) =
lbuffer (limb s) (nlimb s +! nlimb s)
false
Hacl.Impl.Curve25519.AddAndDouble.fst
Hacl.Impl.Curve25519.AddAndDouble.fget_x
val fget_x : h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot Spec.Curve25519.elem
let fget_x (#s:field_spec) (h:mem) (p:point s) = feval h (gsub p 0ul (nlimb s))
{ "file_name": "code/curve25519/Hacl.Impl.Curve25519.AddAndDouble.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 79, "end_line": 36, "start_col": 0, "start_line": 36 }
module Hacl.Impl.Curve25519.AddAndDouble open FStar.HyperStack open FStar.HyperStack.All open FStar.Mul open Lib.IntTypes open Lib.Buffer open Lib.ByteBuffer open Hacl.Impl.Curve25519.Fields module ST = FStar.HyperStack.ST module F51 = Hacl.Impl.Curve25519.Field51 module F64 = Hacl.Impl.Curve25519.Field64 module P = Spec.Curve25519 module S = Hacl.Spec.Curve25519.AddAndDouble #reset-options "--z3rlimit 300 --fuel 0 --ifuel 1 --using_facts_from '* -FStar.Seq' --record_options" inline_for_extraction noextract let point (s:field_spec) = lbuffer (limb s) (nlimb s +! nlimb s) (* NEEDED ONLY FOR WRAPPERS *) inline_for_extraction noextract let point51 = lbuffer uint64 10ul inline_for_extraction noextract let point64 = lbuffer uint64 8ul (* NEEDED ONLY FOR WRAPPERS *) let get_x #s (p:point s) = gsub p 0ul (nlimb s) let get_z #s (p:point s) = gsub p (nlimb s) (nlimb s)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Meta.Attribute.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.Curve25519.AddAndDouble.fst.checked", "Hacl.Impl.Curve25519.Fields.fst.checked", "Hacl.Impl.Curve25519.Field64.fst.checked", "Hacl.Impl.Curve25519.Field51.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Impl.Curve25519.AddAndDouble.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.AddAndDouble", "short_module": "S" }, { "abbrev": true, "full_module": "Spec.Curve25519", "short_module": "P" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field64", "short_module": "F64" }, { "abbrev": true, "full_module": "Hacl.Impl.Curve25519.Field51", "short_module": "F51" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519.Fields", "short_module": null }, { "abbrev": false, "full_module": "Lib.ByteBuffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.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": 1, "max_fuel": 0, "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": 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": 300, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Curve25519.AddAndDouble.point s -> Prims.GTot Spec.Curve25519.elem
Prims.GTot
[ "sometrivial" ]
[]
[ "Hacl.Impl.Curve25519.Fields.Core.field_spec", "FStar.Monotonic.HyperStack.mem", "Hacl.Impl.Curve25519.AddAndDouble.point", "Hacl.Impl.Curve25519.Fields.Core.feval", "Lib.Buffer.gsub", "Lib.Buffer.MUT", "Hacl.Impl.Curve25519.Fields.Core.limb", "Lib.IntTypes.op_Plus_Bang", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Curve25519.Fields.Core.nlimb", "FStar.UInt32.__uint_to_t", "Spec.Curve25519.elem" ]
[]
false
false
false
false
false
let fget_x (#s: field_spec) (h: mem) (p: point s) =
feval h (gsub p 0ul (nlimb s))
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_f_mul
val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 84, "end_line": 402, "start_col": 0, "start_line": 394 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < (Lib.IntTypes.v table_len - 2) / 2} -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> tmp: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Prims.op_Division", "Prims.op_Subtraction", "Lib.IntTypes.op_Star_Bang", "Hacl.Impl.PrecompTable.table_update_sub_len_inv", "Lib.IntTypes.op_Plus_Bang", "FStar.UInt32.__uint_to_t", "Prims.unit", "Prims._assert", "Prims.op_Addition", "Hacl.Impl.PrecompTable.lprecomp_table_mul", "Hacl.Impl.PrecompTable.precomp_table_inv", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Hacl.Impl.PrecompTable.table_sub_len" ]
[]
false
true
false
false
false
let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp =
assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table
val lprecomp_table: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table) h0 h1 /\ (forall (j:nat{j < v table_len}).{:pattern precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j} precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j))
val lprecomp_table: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table) h0 h1 /\ (forall (j:nat{j < v table_len}).{:pattern precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j} precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j))
let lprecomp_table #a_t len ctx_len k ctx a table_len table = push_frame (); let tmp = create len (uint #a_t #SEC 0) in lprecomp_table_noalloc len ctx_len k ctx a table_len table tmp; pop_frame ()
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 14, "end_line": 489, "start_col": 0, "start_line": 485 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp inline_for_extraction noextract val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp = lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp inline_for_extraction noextract val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j)) let lprecomp_table_noalloc #a_t len ctx_len k ctx a table_len table tmp = let t0 = sub table 0ul len in let t1 = sub table len len in k.lone ctx t0; let h0 = ST.get () in copy t1 a; let h1 = ST.get () in //B.modifies_buffer_elim (B.gsub #(uint_t a_t SEC) table 0ul len) (loc t1) h0 h1; LSeq.eq_intro (as_seq h0 t0) (as_seq h1 t0); assert (k.to.linv (as_seq h1 t0) /\ k.to.linv (as_seq h1 t1)); S.lemma_pow0 k.to.comm_monoid (k.to.refl (as_seq h0 a)); S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 0); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 1); [@ inline_let] let inv h (i:nat{i <= (v table_len - 2) / 2}) = modifies (loc table |+| loc tmp) h1 h /\ (forall (j:nat{j < 2 * i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j) in [@inline_let] let nb = (table_len -! 2ul) /. 2ul in Lib.Loops.for 0ul nb inv (fun j -> lprecomp_table_f len ctx_len k ctx a table_len j table tmp)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Lib.IntTypes.op_Star_Bang", "FStar.HyperStack.ST.pop_frame", "Prims.unit", "Hacl.Impl.PrecompTable.lprecomp_table_noalloc", "Lib.Buffer.lbuffer_t", "Lib.Buffer.MUT", "Lib.IntTypes.int_t", "Lib.Buffer.create", "Lib.IntTypes.uint", "FStar.HyperStack.ST.push_frame" ]
[]
false
true
false
false
false
let lprecomp_table #a_t len ctx_len k ctx a table_len table =
push_frame (); let tmp = create len (uint #a_t #SEC 0) in lprecomp_table_noalloc len ctx_len k ctx a table_len table tmp; pop_frame ()
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.table_update_sub_len_inv
val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 80, "end_line": 331, "start_col": 0, "start_line": 314 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < Lib.IntTypes.v table_len} -> b: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Lib.IntTypes.op_Star_Bang", "Prims._assert", "Prims.l_Forall", "Prims.nat", "Prims.op_Addition", "Hacl.Impl.PrecompTable.precomp_table_inv", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "Prims.unit", "Hacl.Impl.PrecompTable.precomp_table_inv_lemma", "Lib.Sequence.eq_intro", "Lib.Sequence.sub", "Prims.eq2", "Lib.Sequence.lseq", "Lib.Sequence.update_sub", "Hacl.Impl.PrecompTable.lemma_table_sub_len", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Hacl.Impl.PrecompTable.table_update_sub_len" ]
[]
false
true
false
false
false
let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b =
let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j: nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j: nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j: nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_noalloc
val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j))
val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j))
let lprecomp_table_noalloc #a_t len ctx_len k ctx a table_len table tmp = let t0 = sub table 0ul len in let t1 = sub table len len in k.lone ctx t0; let h0 = ST.get () in copy t1 a; let h1 = ST.get () in //B.modifies_buffer_elim (B.gsub #(uint_t a_t SEC) table 0ul len) (loc t1) h0 h1; LSeq.eq_intro (as_seq h0 t0) (as_seq h1 t0); assert (k.to.linv (as_seq h1 t0) /\ k.to.linv (as_seq h1 t1)); S.lemma_pow0 k.to.comm_monoid (k.to.refl (as_seq h0 a)); S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 0); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 1); [@ inline_let] let inv h (i:nat{i <= (v table_len - 2) / 2}) = modifies (loc table |+| loc tmp) h1 h /\ (forall (j:nat{j < 2 * i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j) in [@inline_let] let nb = (table_len -! 2ul) /. 2ul in Lib.Loops.for 0ul nb inv (fun j -> lprecomp_table_f len ctx_len k ctx a table_len j table tmp)
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 63, "end_line": 482, "start_col": 0, "start_line": 456 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp inline_for_extraction noextract val lprecomp_table_f_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp = assert (2 * v i + 2 < v table_len); let t2 = table_sub_len len table_len table (2ul *! i +! 2ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (2 * v i + 2)); lprecomp_table_mul len ctx_len k ctx a i t2 tmp; assert (2 * v i + 3 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 3ul) tmp inline_for_extraction noextract val lprecomp_table_f: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 3}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let lprecomp_table_f #a_t len ctx_len k ctx a table_len i table tmp = lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp; lprecomp_table_f_mul #a_t len ctx_len k ctx a table_len i table tmp inline_for_extraction noextract val lprecomp_table_noalloc: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j < v table_len}). precomp_table_inv len ctx_len k (as_seq h1 a) table_len (as_seq h1 table) j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> tmp: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Lib.IntTypes.op_Star_Bang", "Lib.Loops.for", "FStar.UInt32.__uint_to_t", "Hacl.Impl.PrecompTable.lprecomp_table_f", "Prims.unit", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Slash_Dot", "Lib.IntTypes.op_Subtraction_Bang", "FStar.Monotonic.HyperStack.mem", "Prims.nat", "Prims.op_Division", "Prims.op_Subtraction", "Prims.logical", "Lib.Buffer.modifies", "Lib.Buffer.op_Bar_Plus_Bar", "Lib.Buffer.loc", "Lib.Buffer.MUT", "Prims.l_Forall", "Prims.op_Addition", "Hacl.Impl.PrecompTable.precomp_table_inv", "Lib.Buffer.as_seq", "Prims._assert", "Lib.Exponentiation.Definition.lemma_pow1", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__a_spec", "FStar.Ghost.reveal", "Hacl.Impl.Exponentiation.Definitions.to_comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__to", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__comm_monoid", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__refl", "Lib.Exponentiation.Definition.lemma_pow0", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkto_comm_monoid__item__linv", "Lib.Sequence.eq_intro", "FStar.HyperStack.ST.get", "Lib.Buffer.copy", "Hacl.Impl.Exponentiation.Definitions.__proj__Mkconcrete_ops__item__lone", "Lib.Buffer.lbuffer_t", "Lib.Buffer.sub" ]
[]
false
true
false
false
false
let lprecomp_table_noalloc #a_t len ctx_len k ctx a table_len table tmp =
let t0 = sub table 0ul len in let t1 = sub table len len in k.lone ctx t0; let h0 = ST.get () in copy t1 a; let h1 = ST.get () in LSeq.eq_intro (as_seq h0 t0) (as_seq h1 t0); assert (k.to.linv (as_seq h1 t0) /\ k.to.linv (as_seq h1 t1)); S.lemma_pow0 k.to.comm_monoid (k.to.refl (as_seq h0 a)); S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 0); assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) 1); [@@ inline_let ]let inv h (i: nat{i <= (v table_len - 2) / 2}) = modifies (loc table |+| loc tmp) h1 h /\ (forall (j: nat{j < 2 * i + 2}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j) in [@@ inline_let ]let nb = (table_len -! 2ul) /. 2ul in Lib.Loops.for 0ul nb inv (fun j -> lprecomp_table_f len ctx_len k ctx a table_len j table tmp)
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.lprecomp_table_f_sqr
val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp = assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 84, "end_line": 366, "start_col": 0, "start_line": 359 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j) #push-options "--z3rlimit 75" let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j) #pop-options inline_for_extraction noextract val precomp_table_inv_lemma: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table1 j)) (ensures (forall (j:nat{j < i}). precomp_table_inv len ctx_len k a table_len table2 j)) let precomp_table_inv_lemma #a_t len ctx_len k a table_len table1 table2 i = let aux (j:nat{j < i}) : Lemma (precomp_table_inv len ctx_len k a table_len table2 j) = assert (precomp_table_inv len ctx_len k a table_len table1 j); precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j; assert (precomp_table_inv len ctx_len k a table_len table2 j) in Classical.forall_intro aux inline_for_extraction noextract val table_update_sub_len_inv: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h b /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint b table /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h b) /\ k.to.refl (as_seq h b) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i) /\ (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b) /\ (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j)) let table_update_sub_len_inv #a_t len ctx_len k ctx a table_len table i b = let h0 = ST.get () in table_update_sub_len len table_len table i b; let h1 = ST.get () in lemma_table_sub_len (v len) (v table_len) (v i); assert (as_seq h1 table == LSeq.update_sub (as_seq h0 table) (v i * v len) (v len) (as_seq h0 b)); LSeq.eq_intro (LSeq.sub (as_seq h0 table) 0 (v i * v len)) (LSeq.sub (as_seq h1 table) 0 (v i * v len)); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) j); precomp_table_inv_lemma len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (as_seq h1 table) (v i); assert (forall (j:nat{j < v i}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j); assert (forall (j:nat{j < v i + 1}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j) inline_for_extraction noextract val lprecomp_table_f_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t /\ v table_len % 2 = 0} -> i:size_t{v i < (v table_len - 2) / 2} -> table:lbuffer (uint_t a_t SEC) (table_len *! len) -> tmp:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h table /\ live h ctx /\ live h tmp /\ disjoint a table /\ disjoint ctx table /\ disjoint a ctx /\ disjoint tmp table /\ disjoint tmp ctx /\ disjoint tmp a /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ (forall (j:nat{j <= 2 * v i + 1}). precomp_table_inv len ctx_len k (as_seq h a) table_len (as_seq h table) j)) (ensures fun h0 _ h1 -> modifies (loc table |+| loc tmp) h0 h1 /\ (forall (j:nat{j <= 2 * v i + 2}). precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h1 table) j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> ctx: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) ctx_len -> a: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> table_len: Lib.IntTypes.size_t { 1 < Lib.IntTypes.v table_len /\ Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t /\ Lib.IntTypes.v table_len % 2 = 0 } -> i: Lib.IntTypes.size_t{Lib.IntTypes.v i < (Lib.IntTypes.v table_len - 2) / 2} -> table: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (table_len *! len) -> tmp: Lib.Buffer.lbuffer (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) len -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.l_and", "Prims.op_LessThan", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Prims.op_Division", "Prims.op_Subtraction", "Lib.IntTypes.op_Star_Bang", "Hacl.Impl.PrecompTable.table_update_sub_len_inv", "Lib.IntTypes.op_Plus_Bang", "FStar.UInt32.__uint_to_t", "Prims.unit", "Prims._assert", "Prims.op_Addition", "Hacl.Impl.PrecompTable.lprecomp_table_sqr", "Hacl.Impl.PrecompTable.precomp_table_inv", "Lib.Buffer.as_seq", "Lib.Buffer.MUT", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "Lib.Buffer.lbuffer_t", "Lib.IntTypes.int_t", "Hacl.Impl.PrecompTable.table_sub_len" ]
[]
false
true
false
false
false
let lprecomp_table_f_sqr #a_t len ctx_len k ctx a table_len i table tmp =
assert (v i + 1 < v table_len); let t1 = table_sub_len len table_len table (i +! 1ul) in let h0 = ST.get () in assert (precomp_table_inv len ctx_len k (as_seq h0 a) table_len (as_seq h0 table) (v i + 1)); lprecomp_table_sqr len ctx_len k ctx a i t1 tmp; assert (2 * v i + 2 < v table_len); table_update_sub_len_inv len ctx_len k ctx a table_len table (2ul *! i +! 2ul) tmp
false
Hacl.Impl.PrecompTable.fst
Hacl.Impl.PrecompTable.precomp_table_inv_lemma_j
val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j)
val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j)
let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j = assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l:nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j)
{ "file_name": "code/bignum/Hacl.Impl.PrecompTable.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 63, "end_line": 259, "start_col": 0, "start_line": 232 }
module Hacl.Impl.PrecompTable open FStar.Mul open FStar.HyperStack open FStar.HyperStack.ST open FStar.Mul open Lib.IntTypes open Lib.Buffer module ST = FStar.HyperStack.ST module B = LowStar.Buffer module LSeq = Lib.Sequence module Loops = Lib.LoopCombinators module BB = Hacl.Bignum.Base module BD = Hacl.Bignum.Definitions module PT = Hacl.Spec.PrecompTable module S = Lib.Exponentiation.Definition #reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" // val lemma_table_sub_len: len:nat -> table_len:nat -> i:nat{i < table_len} -> // Lemma (i * len + len <= table_len * len) let lemma_table_sub_len len table_len i = Math.Lemmas.distributivity_add_left i 1 len; Math.Lemmas.lemma_mult_le_right len (i + 1) table_len inline_for_extraction noextract let table_gsub_len (#bt:buftype) (#t:BD.limb_t) (len:size_t{v len > 0}) (table_len:size_t{v table_len * v len <= max_size_t}) (table:lbuffer_t bt (uint_t t SEC) (table_len *! len)) (i:size_t{v i < v table_len}) : GTot (lbuffer_t bt (uint_t t SEC) len) = lemma_table_sub_len (v len) (v table_len) (v i); gsub table (i *! len) len inline_for_extraction noextract val table_sub_len: #bt:buftype -> #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer_t bt (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> Stack (lbuffer_t bt (uint_t t SEC) len) (requires fun h -> live h table) (ensures fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == table_gsub_len len table_len table i /\ as_seq h1 r == spec_table_sub_len (v len) (v table_len) (as_seq h0 table) (v i) /\ B.loc_includes (loc table) (loc r)) let table_sub_len #t len table_len table i = lemma_table_sub_len (v len) (v table_len) (v i); sub table (i *! len) len //------------------------------ inline_for_extraction noextract let spec_table_update_sub_len (#t:BD.limb_t) (len:pos) (table_len:size_nat{table_len * len <= max_size_t}) (table:LSeq.lseq (uint_t t SEC) (table_len * len)) (i:nat{i < table_len}) (b:LSeq.lseq (uint_t t SEC) len) : LSeq.lseq (uint_t t SEC) (table_len * len) = lemma_table_sub_len len table_len i; LSeq.update_sub table (i * len) len b inline_for_extraction noextract val table_update_sub_len: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{v table_len * v len <= max_size_t} -> table:lbuffer (uint_t t SEC) (table_len *! len) -> i:size_t{v i < v table_len} -> b:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h b /\ disjoint table b) (ensures fun h0 r h1 -> modifies (loc table) h0 h1 /\ as_seq h1 table == spec_table_update_sub_len (v len) (v table_len) (as_seq h0 table) (v i) (as_seq h0 b)) let table_update_sub_len #t len table_len table i b = lemma_table_sub_len (v len) (v table_len) (v i); update_sub table (i *! len) len b //------------------------------------- inline_for_extraction noextract val table_select_consttime_f: #t:BD.limb_t -> len:size_t{v len > 0} -> table_len:size_t{1 < v table_len /\ v table_len * v len <= max_size_t} -> table:clbuffer (uint_t t SEC) (table_len *! len) -> i:uint_t t SEC{v i < v table_len} -> j:size_t{v j < v table_len - 1} -> acc:lbuffer (uint_t t SEC) len -> Stack unit (requires fun h -> live h table /\ live h acc /\ disjoint table acc) (ensures fun h0 _ h1 -> modifies (loc acc) h0 h1 /\ as_seq h1 acc == PT.table_select_f (v len) (v table_len) (as_seq h0 table) i (v j) (as_seq h0 acc)) let table_select_consttime_f #t len table_len table i j acc = let c = eq_mask i (BB.size_to_limb (j +! 1ul)) in let res_j = table_sub_len len table_len table (j +! 1ul) in map2T len acc (BB.mask_select c) res_j acc let table_select_consttime #t len table_len table i res = let h0 = ST.get () in copy res (table_sub_len len table_len table 0ul); let h1 = ST.get () in assert (as_seq h1 res == LSeq.sub (as_seq h0 table) 0 (v len)); [@ inline_let] let inv h (j:nat{j <= v table_len - 1}) = modifies (loc res) h0 h /\ as_seq h res == Loops.repeati j (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) in Loops.eq_repeati0 (v table_len - 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res); Lib.Loops.for 0ul (table_len -! 1ul) inv (fun j -> Loops.unfold_repeati (v j + 1) (PT.table_select_f (v len) (v table_len) (as_seq h0 table) i) (as_seq h1 res) (v j); table_select_consttime_f len table_len table i j res); PT.table_select_lemma (v len) (v table_len) (as_seq h0 table) i // Precomputed table [a^0 = one; a^1; a^2; ..; a^(table_len - 1)] //---------------------------------------------------------------- inline_for_extraction noextract val lprecomp_table_mul: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (2 * v i + 2)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 3)) let lprecomp_table_mul #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lmul ctx a ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti))); k.to.comm_monoid.lemma_mul_comm (k.to.refl (as_seq h0 a)) (k.to.refl (as_seq h0 ti)); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2) 1; S.lemma_pow1 k.to.comm_monoid (k.to.refl (as_seq h0 a)) inline_for_extraction noextract val lprecomp_table_sqr: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> ctx:lbuffer (uint_t a_t SEC) ctx_len -> a:lbuffer (uint_t a_t SEC) len -> i:size_t -> ti:lbuffer (uint_t a_t SEC) len -> res:lbuffer (uint_t a_t SEC) len -> Stack unit (requires fun h -> live h a /\ live h ti /\ live h ctx /\ live h res /\ disjoint a ti /\ disjoint a ctx /\ disjoint a res /\ disjoint ti ctx /\ disjoint ti res /\ disjoint ctx res /\ k.to.linv (as_seq h a) /\ k.to.linv_ctx (as_seq h ctx) /\ k.to.linv (as_seq h ti) /\ k.to.refl (as_seq h ti) == S.pow k.to.comm_monoid (k.to.refl (as_seq h a)) (v i + 1)) (ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\ k.to.linv (as_seq h1 res) /\ k.to.refl (as_seq h1 res) == S.pow k.to.comm_monoid (k.to.refl (as_seq h0 a)) (2 * v i + 2)) let lprecomp_table_sqr #a_t len ctx_len k ctx a i ti res = let h0 = ST.get () in k.lsqr ctx ti res; let h1 = ST.get () in assert (k.to.refl (as_seq h1 res) == k.to.comm_monoid.S.mul (k.to.refl (as_seq h0 ti)) (k.to.refl (as_seq h0 ti))); S.lemma_pow_add k.to.comm_monoid (k.to.refl (as_seq h0 a)) (v i + 1) (v i + 1) inline_for_extraction noextract val precomp_table_inv_lemma_j: #a_t:inttype_a -> len:size_t{v len > 0} -> ctx_len:size_t -> k:concrete_ops a_t len ctx_len -> a:LSeq.lseq (uint_t a_t SEC) (v len) -> table_len:size_t{v table_len * v len <= max_size_t} -> table1:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> table2:LSeq.lseq (uint_t a_t SEC) (v table_len * v len) -> i:nat{i <= v table_len} -> j:nat{j < i} -> Lemma (requires LSeq.sub table1 0 (i * v len) == LSeq.sub table2 0 (i * v len) /\ precomp_table_inv len ctx_len k a table_len table1 j) (ensures precomp_table_inv len ctx_len k a table_len table2 j)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowStar.Buffer.fst.checked", "Lib.Sequence.fsti.checked", "Lib.RawIntTypes.fsti.checked", "Lib.Loops.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Lib.Exponentiation.Definition.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Spec.PrecompTable.fst.checked", "Hacl.Bignum.Definitions.fst.checked", "Hacl.Bignum.Base.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Impl.PrecompTable.fst" }
[ { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Hacl.Spec.PrecompTable", "short_module": "PT" }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Hacl.Bignum.Base", "short_module": "BB" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Exponentiation.Definitions", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Bignum.Definitions", "short_module": "BD" }, { "abbrev": true, "full_module": "Lib.Exponentiation.Definition", "short_module": "S" }, { "abbrev": true, "full_module": "Lib.Sequence", "short_module": "LSeq" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "Lib.Buffer", "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": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl", "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": 75, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
len: Lib.IntTypes.size_t{Lib.IntTypes.v len > 0} -> ctx_len: Lib.IntTypes.size_t -> k: Hacl.Impl.Exponentiation.Definitions.concrete_ops a_t len ctx_len -> a: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v len) -> table_len: Lib.IntTypes.size_t{Lib.IntTypes.v table_len * Lib.IntTypes.v len <= Lib.IntTypes.max_size_t} -> table1: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v table_len * Lib.IntTypes.v len) -> table2: Lib.Sequence.lseq (Lib.IntTypes.uint_t a_t Lib.IntTypes.SEC) (Lib.IntTypes.v table_len * Lib.IntTypes.v len) -> i: Prims.nat{i <= Lib.IntTypes.v table_len} -> j: Prims.nat{j < i} -> FStar.Pervasives.Lemma (requires Lib.Sequence.sub table1 0 (i * Lib.IntTypes.v len) == Lib.Sequence.sub table2 0 (i * Lib.IntTypes.v len) /\ Hacl.Impl.PrecompTable.precomp_table_inv len ctx_len k a table_len table1 j) (ensures Hacl.Impl.PrecompTable.precomp_table_inv len ctx_len k a table_len table2 j)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Impl.Exponentiation.Definitions.inttype_a", "Lib.IntTypes.size_t", "Prims.b2t", "Prims.op_GreaterThan", "Lib.IntTypes.v", "Lib.IntTypes.U32", "Lib.IntTypes.PUB", "Hacl.Impl.Exponentiation.Definitions.concrete_ops", "Lib.Sequence.lseq", "Lib.IntTypes.uint_t", "Lib.IntTypes.SEC", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.nat", "Prims.op_LessThan", "Prims._assert", "Hacl.Impl.PrecompTable.precomp_table_inv", "Prims.unit", "Lib.Sequence.eq_intro", "FStar.Classical.forall_intro", "Prims.eq2", "Prims.l_or", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.Sequence.index", "Prims.l_True", "Prims.squash", "Lib.IntTypes.int_t", "Prims.Nil", "FStar.Pervasives.pattern", "Prims.op_Addition", "FStar.Seq.Base.lemma_index_slice", "FStar.Math.Lemmas.lemma_mult_lt_right", "FStar.Math.Lemmas.distributivity_add_left", "FStar.Math.Lemmas.lemma_mult_le_right", "Hacl.Impl.PrecompTable.lemma_table_sub_len", "Hacl.Impl.PrecompTable.spec_table_sub_len" ]
[]
false
false
true
false
false
let precomp_table_inv_lemma_j #a_t len ctx_len k a table_len table1 table2 i j =
assert (j < v table_len); assert (precomp_table_inv len ctx_len k a table_len table1 j); let bj1 = spec_table_sub_len (v len) (v table_len) table1 j in let bj2 = spec_table_sub_len (v len) (v table_len) table2 j in let aux (l: nat{l < v len}) : Lemma (LSeq.index bj1 l == LSeq.index bj2 l) = lemma_table_sub_len (v len) (v table_len) j; assert (j * v len + v len <= v table_len * v len); Seq.lemma_index_slice table1 (j * v len) (j * v len + v len) l; assert (LSeq.index bj1 l == LSeq.index table1 (j * v len + l)); Seq.lemma_index_slice table2 (j * v len) (j * v len + v len) l; assert (LSeq.index bj2 l == LSeq.index table2 (j * v len + l)); Math.Lemmas.lemma_mult_le_right (v len) i (v table_len); assert (i * v len <= v table_len * v len); Math.Lemmas.distributivity_add_left j 1 (v len); Math.Lemmas.lemma_mult_lt_right (v len) j i; assert (j * v len + l < i * v len); Seq.lemma_index_slice table1 0 (i * v len) (j * v len + l); Seq.lemma_index_slice table2 0 (i * v len) (j * v len + l); assert (LSeq.index table1 (j * v len + l) == LSeq.index table2 (j * v len + l)); assert (LSeq.index bj1 l == LSeq.index bj2 l) in Classical.forall_intro aux; LSeq.eq_intro bj1 bj2; assert (precomp_table_inv len ctx_len k a table_len table2 j)
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_lemma_KeyExpansion256Stdcall
val va_lemma_KeyExpansion256Stdcall : va_b0:va_code -> va_s0:va_state -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansion256Stdcall ()) va_s0 /\ va_get_ok va_s0 /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) input_key_b 2 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) output_key_expansion_b 15 (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 (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j)) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
val va_lemma_KeyExpansion256Stdcall : va_b0:va_code -> va_s0:va_state -> input_key_b:buffer128 -> output_key_expansion_b:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansion256Stdcall ()) va_s0 /\ va_get_ok va_s0 /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) input_key_b 2 (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) output_key_expansion_b 15 (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 (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j)) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 702, "start_col": 0, "start_line": 667 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (()))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.PPC64LE.Decls.va_code -> va_s0: Vale.PPC64LE.Decls.va_state -> input_key_b: Vale.PPC64LE.Memory.buffer128 -> output_key_expansion_b: Vale.PPC64LE.Memory.buffer128 -> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.PPC64LE.Decls.va_fuel", "Vale.PPC64LE.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.PPC64LE.QuickCode.mod_t", "Vale.PPC64LE.QuickCode.va_Mod_vec", "Vale.PPC64LE.QuickCode.va_Mod_reg", "Vale.PPC64LE.QuickCode.va_Mod_mem_heaplet", "Vale.PPC64LE.QuickCode.va_Mod_ok", "Vale.PPC64LE.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.PPC64LE.QuickCode.__proj__QProc__item__mods", "Vale.AES.PPC64LE.AES256.va_code_KeyExpansion256Stdcall", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.PPC64LE.QuickCodes.label", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Vale.PPC64LE.Decls.va_get_ok", "Vale.PPC64LE.Decls.validSrcAddrs128", "Vale.PPC64LE.Decls.va_get_mem_heaplet", "Vale.PPC64LE.Decls.va_get_reg", "Vale.PPC64LE.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.Decls.validDstAddrs128", "FStar.Seq.Base.seq", "Vale.Def.Words_s.nat32", "Vale.AES.AES256_helpers_BE.make_AES256_key", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.PPC64LE.Decls.buffer128_read", "Vale.PPC64LE.Decls.modifies_buffer128", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.quad32", "FStar.Seq.Base.index", "Vale.AES.AES_BE_s.key_to_round_keys_word", "Vale.AES.AES_common_s.AES_256", "Vale.PPC64LE.QuickCode.quickCode", "Vale.AES.PPC64LE.AES256.va_qcode_KeyExpansion256Stdcall" ]
[]
false
false
false
false
false
let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b =
let va_mods:va_mods_t = [ va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j: nat). {:pattern (reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))} j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
MerkleTree.Low.fst
MerkleTree.Low.insert_
val insert_: #hsz:hash_size_t -> #hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> acc:hash #hsz -> hash_fun:hash_fun_t #hsz #hash_spec -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 acc /\ HH.disjoint (V.frameOf hs) (B.frameOf acc) /\ mt_safe_elts h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (loc_union (RV.rv_loc_elems h0 hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 acc /\ mt_safe_elts h1 lv hs (Ghost.reveal i) (j + 1ul) /\ // correctness (mt_safe_elts_spec h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 acc))))) (decreases (U32.v j))
val insert_: #hsz:hash_size_t -> #hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> acc:hash #hsz -> hash_fun:hash_fun_t #hsz #hash_spec -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 acc /\ HH.disjoint (V.frameOf hs) (B.frameOf acc) /\ mt_safe_elts h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (loc_union (RV.rv_loc_elems h0 hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 acc /\ mt_safe_elts h1 lv hs (Ghost.reveal i) (j + 1ul) /\ // correctness (mt_safe_elts_spec h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 acc))))) (decreases (U32.v j))
let rec insert_ #hsz #hash_spec lv i j hs acc hash_fun = let hh0 = HST.get () in hash_vv_insert_copy lv i j hs acc; let hh1 = HST.get () in // Base conditions V.loc_vector_within_included hs lv (lv + 1ul); V.loc_vector_within_included hs (lv + 1ul) (V.size_of hs); V.loc_vector_within_disjoint hs lv (lv + 1ul) (lv + 1ul) (V.size_of hs); assert (V.size_of (V.get hh1 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul)); if j % 2ul = 1ul then (insert_index_helper_odd lv (Ghost.reveal i) j; assert (S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) > 0); let lvhs = V.index hs lv in assert (U32.v (V.size_of lvhs) == S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) + 1); assert (V.size_of lvhs > 1ul); /// 3) Update the accumulator `acc`. hash_vec_rv_inv_r_inv hh1 (V.get hh1 hs lv) (V.size_of (V.get hh1 hs lv) - 2ul); assert (Rgl?.r_inv (hreg hsz) hh1 acc); hash_fun (V.index lvhs (V.size_of lvhs - 2ul)) acc acc; let hh2 = HST.get () in // 3-1) For the `modifies` postcondition assert (modifies (B.loc_all_regions_from false (B.frameOf acc)) hh1 hh2); assert (modifies (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh2); // 3-2) Preservation RV.rv_inv_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.as_seq_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; assert (RV.rv_inv hh2 hs); assert (Rgl?.r_inv (hreg hsz) hh2 acc); // 3-3) For `mt_safe_elts` V.get_preserved hs lv (B.loc_region_only false (B.frameOf acc)) hh1 hh2; // head preserved mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; // tail preserved // 3-4) Correctness insert_snoc_last_helper (RV.as_seq hh0 (V.get hh0 hs lv)) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (Rgl?.r_repr (hreg hsz) hh2 acc) // `nacc` in `MTH.insert_` ((Ghost.reveal hash_spec) (S.last (S.index (RV.as_seq hh0 hs) (U32.v lv))) (Rgl?.r_repr (hreg hsz) hh0 acc))); /// 4) Recursion insert_ (lv + 1ul) (Ghost.hide (Ghost.reveal i / 2ul)) (j / 2ul) hs acc hash_fun; let hh3 = HST.get () in // 4-0) Memory safety brought from the postcondition of the recursion assert (RV.rv_inv hh3 hs); assert (Rgl?.r_inv (hreg hsz) hh3 acc); assert (modifies (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3); assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh3); // 4-1) For `mt_safe_elts` rv_inv_rv_elems_reg hh2 hs (lv + 1ul) (V.size_of hs); RV.rv_loc_elems_included hh2 hs (lv + 1ul) (V.size_of hs); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (B.loc_all_regions_from false (B.frameOf acc))); V.get_preserved hs lv (loc_union (loc_union (V.loc_vector_within hs (lv + 1ul) (V.size_of hs)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3; assert (V.size_of (V.get hh3 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); // head preserved assert (mt_safe_elts hh3 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul + 1ul)); // tail by recursion mt_safe_elts_constr hh3 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh3 lv hs (Ghost.reveal i) (j + 1ul)); // 4-2) Correctness mt_safe_elts_spec hh2 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv + 1) (U32.v (Ghost.reveal i) / 2) (U32.v j / 2) (RV.as_seq hh2 hs) (Rgl?.r_repr (hreg hsz) hh2 acc))); mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_rec #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))) else (insert_index_helper_even lv j; // memory safety assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) ((j + 1ul) / 2ul)); mt_safe_elts_constr hh1 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh1 lv hs (Ghost.reveal i) (j + 1ul)); assert (modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) hh0 hh1); insert_modifies_union_loc_weakening (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc)) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh1; // correctness mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_base #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh1 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))); /// 5) Proving the postcondition after recursion let hh4 = HST.get () in // 5-1) For the `modifies` postcondition. assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh4); insert_modifies_rec_helper lv hs (B.loc_all_regions_from false (B.frameOf acc)) hh0; // 5-2) For `mt_safe_elts` assert (mt_safe_elts hh4 lv hs (Ghost.reveal i) (j + 1ul)); // 5-3) Preservation assert (RV.rv_inv hh4 hs); assert (Rgl?.r_inv (hreg hsz) hh4 acc); // 5-4) Correctness mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; assert (S.equal (RV.as_seq hh4 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))
{ "file_name": "src/MerkleTree.Low.fst", "git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
{ "end_col": 73, "end_line": 922, "start_col": 0, "start_line": 734 }
module MerkleTree.Low open EverCrypt.Helpers open FStar.All open FStar.Integers open FStar.Mul open LowStar.Buffer open LowStar.BufferOps open LowStar.Vector open LowStar.Regional open LowStar.RVector open LowStar.Regional.Instances module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MHS = FStar.Monotonic.HyperStack module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module S = FStar.Seq module U32 = FStar.UInt32 module U64 = FStar.UInt64 module MTH = MerkleTree.New.High module MTS = MerkleTree.Spec open Lib.IntTypes open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions open MerkleTree.Low.VectorExtras #set-options "--z3rlimit 10 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" type const_pointer (a:Type0) = b:CB.const_buffer a{CB.length b == 1 /\ CB.qual_of b == CB.MUTABLE} /// Low-level Merkle tree data structure /// // NOTE: because of a lack of 64-bit LowStar.Buffer support, currently // we cannot change below to some other types. type index_t = uint32_t let uint32_32_max = 4294967295ul inline_for_extraction let uint32_max = 4294967295UL let uint64_max = 18446744073709551615UL let offset_range_limit = uint32_max type offset_t = uint64_t inline_for_extraction noextract unfold let u32_64 = Int.Cast.uint32_to_uint64 inline_for_extraction noextract unfold let u64_32 = Int.Cast.uint64_to_uint32 private inline_for_extraction let offsets_connect (x:offset_t) (y:offset_t): Tot bool = y >= x && (y - x) <= offset_range_limit private inline_for_extraction let split_offset (tree:offset_t) (index:offset_t{offsets_connect tree index}): Tot index_t = [@inline_let] let diff = U64.sub_mod index tree in assert (diff <= offset_range_limit); Int.Cast.uint64_to_uint32 diff private inline_for_extraction let add64_fits (x:offset_t) (i:index_t): Tot bool = uint64_max - x >= (u32_64 i) private inline_for_extraction let join_offset (tree:offset_t) (i:index_t{add64_fits tree i}): Tot (r:offset_t{offsets_connect tree r}) = U64.add tree (u32_64 i) inline_for_extraction val merkle_tree_size_lg: uint32_t let merkle_tree_size_lg = 32ul // A Merkle tree `MT i j hs rhs_ok rhs` stores all necessary hashes to generate // a Merkle path for each element from the index `i` to `j-1`. // - Parameters // `hs`: a 2-dim store for hashes, where `hs[0]` contains leaf hash values. // `rhs_ok`: to check the rightmost hashes are up-to-date // `rhs`: a store for "rightmost" hashes, manipulated only when required to // calculate some merkle paths that need the rightmost hashes // as a part of them. // `mroot`: during the construction of `rhs` we can also calculate the Merkle // root of the tree. If `rhs_ok` is true then it has the up-to-date // root value. noeq type merkle_tree = | MT: hash_size:hash_size_t -> offset:offset_t -> i:index_t -> j:index_t{i <= j /\ add64_fits offset j} -> hs:hash_vv hash_size {V.size_of hs = merkle_tree_size_lg} -> rhs_ok:bool -> rhs:hash_vec #hash_size {V.size_of rhs = merkle_tree_size_lg} -> mroot:hash #hash_size -> hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hash_size)) -> hash_fun:hash_fun_t #hash_size #hash_spec -> merkle_tree type mt_p = B.pointer merkle_tree type const_mt_p = const_pointer merkle_tree inline_for_extraction let merkle_tree_conditions (#hsz:Ghost.erased hash_size_t) (offset:uint64_t) (i j:uint32_t) (hs:hash_vv hsz) (rhs_ok:bool) (rhs:hash_vec #hsz) (mroot:hash #hsz): Tot bool = j >= i && add64_fits offset j && V.size_of hs = merkle_tree_size_lg && V.size_of rhs = merkle_tree_size_lg // The maximum number of currently held elements in the tree is (2^32 - 1). // cwinter: even when using 64-bit indices, we fail if the underlying 32-bit // vector is full; this can be fixed if necessary. private inline_for_extraction val mt_not_full_nst: mtv:merkle_tree -> Tot bool let mt_not_full_nst mtv = MT?.j mtv < uint32_32_max val mt_not_full: HS.mem -> mt_p -> GTot bool let mt_not_full h mt = mt_not_full_nst (B.get h mt 0) /// (Memory) Safety val offset_of: i:index_t -> Tot index_t let offset_of i = if i % 2ul = 0ul then i else i - 1ul // `mt_safe_elts` says that it is safe to access an element from `i` to `j - 1` // at level `lv` in the Merkle tree, i.e., hs[lv][k] (i <= k < j) is a valid // element. inline_for_extraction noextract val mt_safe_elts: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> GTot Type0 (decreases (32 - U32.v lv)) let rec mt_safe_elts #hsz h lv hs i j = if lv = merkle_tree_size_lg then true else (let ofs = offset_of i in V.size_of (V.get h hs lv) == j - ofs /\ mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul)) #push-options "--initial_fuel 1 --max_fuel 1" val mt_safe_elts_constr: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (V.size_of (V.get h hs lv) == j - offset_of i /\ mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul))) (ensures (mt_safe_elts #hsz h lv hs i j)) let mt_safe_elts_constr #_ h lv hs i j = () val mt_safe_elts_head: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (mt_safe_elts #hsz h lv hs i j)) (ensures (V.size_of (V.get h hs lv) == j - offset_of i)) let mt_safe_elts_head #_ h lv hs i j = () val mt_safe_elts_rec: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (mt_safe_elts #hsz h lv hs i j)) (ensures (mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul))) let mt_safe_elts_rec #_ h lv hs i j = () val mt_safe_elts_init: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> Lemma (requires (V.forall_ h hs lv (V.size_of hs) (fun hv -> V.size_of hv = 0ul))) (ensures (mt_safe_elts #hsz h lv hs 0ul 0ul)) (decreases (32 - U32.v lv)) let rec mt_safe_elts_init #hsz h lv hs = if lv = merkle_tree_size_lg then () else mt_safe_elts_init #hsz h (lv + 1ul) hs #pop-options val mt_safe_elts_preserved: #hsz:hash_size_t -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (V.live h0 hs /\ mt_safe_elts #hsz h0 lv hs i j /\ loc_disjoint p (V.loc_vector_within hs lv (V.size_of hs)) /\ modifies p h0 h1)) (ensures (mt_safe_elts #hsz h1 lv hs i j)) (decreases (32 - U32.v lv)) [SMTPat (V.live h0 hs); SMTPat (mt_safe_elts #hsz h0 lv hs i j); SMTPat (loc_disjoint p (RV.loc_rvector hs)); SMTPat (modifies p h0 h1)] #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let rec mt_safe_elts_preserved #hsz lv hs i j p h0 h1 = if lv = merkle_tree_size_lg then () else (V.get_preserved hs lv p h0 h1; mt_safe_elts_preserved #hsz (lv + 1ul) hs (i / 2ul) (j / 2ul) p h0 h1) #pop-options // `mt_safe` is the invariant of a Merkle tree through its lifetime. // It includes liveness, regionality, disjointness (to each data structure), // and valid element access (`mt_safe_elts`). inline_for_extraction noextract val mt_safe: HS.mem -> mt_p -> GTot Type0 let mt_safe h mt = B.live h mt /\ B.freeable mt /\ (let mtv = B.get h mt 0 in // Liveness & Accessibility RV.rv_inv h (MT?.hs mtv) /\ RV.rv_inv h (MT?.rhs mtv) /\ Rgl?.r_inv (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv) /\ mt_safe_elts h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv) /\ // Regionality HH.extends (V.frameOf (MT?.hs mtv)) (B.frameOf mt) /\ HH.extends (V.frameOf (MT?.rhs mtv)) (B.frameOf mt) /\ HH.extends (B.frameOf (MT?.mroot mtv)) (B.frameOf mt) /\ HH.disjoint (V.frameOf (MT?.hs mtv)) (V.frameOf (MT?.rhs mtv)) /\ HH.disjoint (V.frameOf (MT?.hs mtv)) (B.frameOf (MT?.mroot mtv)) /\ HH.disjoint (V.frameOf (MT?.rhs mtv)) (B.frameOf (MT?.mroot mtv))) // Since a Merkle tree satisfies regionality, it's ok to take all regions from // a tree pointer as a location of the tree. val mt_loc: mt_p -> GTot loc let mt_loc mt = B.loc_all_regions_from false (B.frameOf mt) val mt_safe_preserved: mt:mt_p -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (mt_safe h0 mt /\ loc_disjoint p (mt_loc mt) /\ modifies p h0 h1)) (ensures (B.get h0 mt 0 == B.get h1 mt 0 /\ mt_safe h1 mt)) let mt_safe_preserved mt p h0 h1 = assert (loc_includes (mt_loc mt) (B.loc_buffer mt)); let mtv = B.get h0 mt 0 in assert (loc_includes (mt_loc mt) (RV.loc_rvector (MT?.hs mtv))); assert (loc_includes (mt_loc mt) (RV.loc_rvector (MT?.rhs mtv))); assert (loc_includes (mt_loc mt) (V.loc_vector (MT?.hs mtv))); assert (loc_includes (mt_loc mt) (B.loc_all_regions_from false (B.frameOf (MT?.mroot mtv)))); RV.rv_inv_preserved (MT?.hs mtv) p h0 h1; RV.rv_inv_preserved (MT?.rhs mtv) p h0 h1; Rgl?.r_sep (hreg (MT?.hash_size mtv)) (MT?.mroot mtv) p h0 h1; V.loc_vector_within_included (MT?.hs mtv) 0ul (V.size_of (MT?.hs mtv)); mt_safe_elts_preserved 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv) p h0 h1 /// Lifting to a high-level Merkle tree structure val mt_safe_elts_spec: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (RV.rv_inv h hs /\ mt_safe_elts #hsz h lv hs i j)) (ensures (MTH.hs_wf_elts #(U32.v hsz) (U32.v lv) (RV.as_seq h hs) (U32.v i) (U32.v j))) (decreases (32 - U32.v lv)) #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let rec mt_safe_elts_spec #_ h lv hs i j = if lv = merkle_tree_size_lg then () else mt_safe_elts_spec h (lv + 1ul) hs (i / 2ul) (j / 2ul) #pop-options val merkle_tree_lift: h:HS.mem -> mtv:merkle_tree{ RV.rv_inv h (MT?.hs mtv) /\ RV.rv_inv h (MT?.rhs mtv) /\ Rgl?.r_inv (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv) /\ mt_safe_elts #(MT?.hash_size mtv) h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv)} -> GTot (r:MTH.merkle_tree #(U32.v (MT?.hash_size mtv)) {MTH.mt_wf_elts #_ r}) let merkle_tree_lift h mtv = mt_safe_elts_spec h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv); MTH.MT #(U32.v (MT?.hash_size mtv)) (U32.v (MT?.i mtv)) (U32.v (MT?.j mtv)) (RV.as_seq h (MT?.hs mtv)) (MT?.rhs_ok mtv) (RV.as_seq h (MT?.rhs mtv)) (Rgl?.r_repr (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv)) (Ghost.reveal (MT?.hash_spec mtv)) val mt_lift: h:HS.mem -> mt:mt_p{mt_safe h mt} -> GTot (r:MTH.merkle_tree #(U32.v (MT?.hash_size (B.get h mt 0))) {MTH.mt_wf_elts #_ r}) let mt_lift h mt = merkle_tree_lift h (B.get h mt 0) val mt_preserved: mt:mt_p -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (mt_safe h0 mt /\ loc_disjoint p (mt_loc mt) /\ modifies p h0 h1)) (ensures (mt_safe_preserved mt p h0 h1; mt_lift h0 mt == mt_lift h1 mt)) let mt_preserved mt p h0 h1 = assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (B.loc_buffer mt)); B.modifies_buffer_elim mt p h0 h1; assert (B.get h0 mt 0 == B.get h1 mt 0); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (RV.loc_rvector (MT?.hs (B.get h0 mt 0)))); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (RV.loc_rvector (MT?.rhs (B.get h0 mt 0)))); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (B.loc_buffer (MT?.mroot (B.get h0 mt 0)))); RV.as_seq_preserved (MT?.hs (B.get h0 mt 0)) p h0 h1; RV.as_seq_preserved (MT?.rhs (B.get h0 mt 0)) p h0 h1; B.modifies_buffer_elim (MT?.mroot (B.get h0 mt 0)) p h0 h1 /// Construction // Note that the public function for creation is `mt_create` defined below, // which builds a tree with an initial hash. #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" private val create_empty_mt: hash_size:hash_size_t -> hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hash_size)) -> hash_fun:hash_fun_t #hash_size #hash_spec -> r:HST.erid -> HST.ST mt_p (requires (fun _ -> true)) (ensures (fun h0 mt h1 -> let dmt = B.get h1 mt 0 in // memory safety B.frameOf mt = r /\ modifies (mt_loc mt) h0 h1 /\ mt_safe h1 mt /\ mt_not_full h1 mt /\ // correctness MT?.hash_size dmt = hash_size /\ MT?.offset dmt = 0UL /\ merkle_tree_lift h1 dmt == MTH.create_empty_mt #_ #(Ghost.reveal hash_spec) ())) let create_empty_mt hsz hash_spec hash_fun r = [@inline_let] let hrg = hreg hsz in [@inline_let] let hvrg = hvreg hsz in [@inline_let] let hvvrg = hvvreg hsz in let hs_region = HST.new_region r in let hs = RV.alloc_rid hvrg merkle_tree_size_lg hs_region in let h0 = HST.get () in mt_safe_elts_init #hsz h0 0ul hs; let rhs_region = HST.new_region r in let rhs = RV.alloc_rid hrg merkle_tree_size_lg rhs_region in let h1 = HST.get () in assert (RV.as_seq h1 rhs == S.create 32 (MTH.hash_init #(U32.v hsz))); RV.rv_inv_preserved hs (V.loc_vector rhs) h0 h1; RV.as_seq_preserved hs (V.loc_vector rhs) h0 h1; V.loc_vector_within_included hs 0ul (V.size_of hs); mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul (V.loc_vector rhs) h0 h1; let mroot_region = HST.new_region r in let mroot = rg_alloc hrg mroot_region in let h2 = HST.get () in RV.as_seq_preserved hs loc_none h1 h2; RV.as_seq_preserved rhs loc_none h1 h2; mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul loc_none h1 h2; let mt = B.malloc r (MT hsz 0UL 0ul 0ul hs false rhs mroot hash_spec hash_fun) 1ul in let h3 = HST.get () in RV.as_seq_preserved hs loc_none h2 h3; RV.as_seq_preserved rhs loc_none h2 h3; Rgl?.r_sep hrg mroot loc_none h2 h3; mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul loc_none h2 h3; mt #pop-options /// Destruction (free) val mt_free: mt:mt_p -> HST.ST unit (requires (fun h0 -> mt_safe h0 mt)) (ensures (fun h0 _ h1 -> modifies (mt_loc mt) h0 h1)) #push-options "--z3rlimit 100" let mt_free mt = let mtv = !*mt in RV.free (MT?.hs mtv); RV.free (MT?.rhs mtv); [@inline_let] let rg = hreg (MT?.hash_size mtv) in rg_free rg (MT?.mroot mtv); B.free mt #pop-options /// Insertion private val as_seq_sub_upd: #a:Type0 -> #rst:Type -> #rg:regional rst a -> h:HS.mem -> rv:rvector #a #rst rg -> i:uint32_t{i < V.size_of rv} -> v:Rgl?.repr rg -> Lemma (requires (RV.rv_inv h rv)) (ensures (S.equal (S.upd (RV.as_seq h rv) (U32.v i) v) (S.append (RV.as_seq_sub h rv 0ul i) (S.cons v (RV.as_seq_sub h rv (i + 1ul) (V.size_of rv)))))) #push-options "--z3rlimit 20" let as_seq_sub_upd #a #rst #rg h rv i v = Seq.Properties.slice_upd (RV.as_seq h rv) 0 (U32.v i) (U32.v i) v; Seq.Properties.slice_upd (RV.as_seq h rv) (U32.v i + 1) (U32.v (V.size_of rv)) (U32.v i) v; RV.as_seq_seq_slice rg h (V.as_seq h rv) 0 (U32.v (V.size_of rv)) 0 (U32.v i); assert (S.equal (S.slice (RV.as_seq h rv) 0 (U32.v i)) (RV.as_seq_sub h rv 0ul i)); RV.as_seq_seq_slice rg h (V.as_seq h rv) 0 (U32.v (V.size_of rv)) (U32.v i + 1) (U32.v (V.size_of rv)); assert (S.equal (S.slice (RV.as_seq h rv) (U32.v i + 1) (U32.v (V.size_of rv))) (RV.as_seq_sub h rv (i + 1ul) (V.size_of rv))); assert (S.index (S.upd (RV.as_seq h rv) (U32.v i) v) (U32.v i) == v) #pop-options // `hash_vv_insert_copy` inserts a hash element at a level `lv`, by copying // and pushing its content to `hs[lv]`. For detailed insertion procedure, see // `insert_` and `mt_insert`. #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1" private inline_for_extraction val hash_vv_insert_copy: #hsz:hash_size_t -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> v:hash #hsz -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 v /\ HH.disjoint (V.frameOf hs) (B.frameOf v) /\ mt_safe_elts #hsz h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 v /\ V.size_of (V.get h1 hs lv) == j + 1ul - offset_of (Ghost.reveal i) /\ V.size_of (V.get h1 hs lv) == V.size_of (V.get h0 hs lv) + 1ul /\ mt_safe_elts #hsz h1 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) /\ RV.rv_loc_elems h0 hs (lv + 1ul) (V.size_of hs) == RV.rv_loc_elems h1 hs (lv + 1ul) (V.size_of hs) /\ // correctness (mt_safe_elts_spec #hsz h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.hashess_insert (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 v))) /\ S.equal (S.index (RV.as_seq h1 hs) (U32.v lv)) (S.snoc (S.index (RV.as_seq h0 hs) (U32.v lv)) (Rgl?.r_repr (hreg hsz) h0 v)))) let hash_vv_insert_copy #hsz lv i j hs v = let hh0 = HST.get () in mt_safe_elts_rec hh0 lv hs (Ghost.reveal i) j; /// 1) Insert an element at the level `lv`, where the new vector is not yet /// connected to `hs`. let ihv = RV.insert_copy (hcpy hsz) (V.index hs lv) v in let hh1 = HST.get () in // 1-0) Basic disjointness conditions V.forall2_forall_left hh0 hs 0ul (V.size_of hs) lv (fun b1 b2 -> HH.disjoint (Rgl?.region_of (hvreg hsz) b1) (Rgl?.region_of (hvreg hsz) b2)); V.forall2_forall_right hh0 hs 0ul (V.size_of hs) lv (fun b1 b2 -> HH.disjoint (Rgl?.region_of (hvreg hsz) b1) (Rgl?.region_of (hvreg hsz) b2)); V.loc_vector_within_included hs lv (lv + 1ul); V.loc_vector_within_included hs (lv + 1ul) (V.size_of hs); V.loc_vector_within_disjoint hs lv (lv + 1ul) (lv + 1ul) (V.size_of hs); // 1-1) For the `modifies` postcondition. assert (modifies (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) hh0 hh1); // 1-2) Preservation Rgl?.r_sep (hreg hsz) v (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; // 1-3) For `mt_safe_elts` assert (V.size_of ihv == j + 1ul - offset_of (Ghost.reveal i)); // head updated mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; // tail not yet // 1-4) For the `rv_inv` postcondition RV.rs_loc_elems_elem_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v (V.size_of hs)) 0 (U32.v lv) (U32.v lv); RV.rs_loc_elems_parent_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v lv); RV.rv_elems_inv_preserved hs 0ul lv (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; assert (RV.rv_elems_inv hh1 hs 0ul lv); RV.rs_loc_elems_elem_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v (V.size_of hs)) (U32.v lv + 1) (U32.v (V.size_of hs)) (U32.v lv); RV.rs_loc_elems_parent_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) (U32.v lv + 1) (U32.v (V.size_of hs)); RV.rv_elems_inv_preserved hs (lv + 1ul) (V.size_of hs) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; assert (RV.rv_elems_inv hh1 hs (lv + 1ul) (V.size_of hs)); // assert (rv_itself_inv hh1 hs); // assert (elems_reg hh1 hs); // 1-5) Correctness assert (S.equal (RV.as_seq hh1 ihv) (S.snoc (RV.as_seq hh0 (V.get hh0 hs lv)) (Rgl?.r_repr (hreg hsz) hh0 v))); /// 2) Assign the updated vector to `hs` at the level `lv`. RV.assign hs lv ihv; let hh2 = HST.get () in // 2-1) For the `modifies` postcondition. assert (modifies (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2); assert (modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) hh0 hh2); // 2-2) Preservation Rgl?.r_sep (hreg hsz) v (RV.loc_rvector hs) hh1 hh2; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2; // 2-3) For `mt_safe_elts` assert (V.size_of (V.get hh2 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2; // 2-4) Correctness RV.as_seq_sub_preserved hs 0ul lv (loc_rvector ihv) hh0 hh1; RV.as_seq_sub_preserved hs (lv + 1ul) merkle_tree_size_lg (loc_rvector ihv) hh0 hh1; assert (S.equal (RV.as_seq hh2 hs) (S.append (RV.as_seq_sub hh0 hs 0ul lv) (S.cons (RV.as_seq hh1 ihv) (RV.as_seq_sub hh0 hs (lv + 1ul) merkle_tree_size_lg)))); as_seq_sub_upd hh0 hs lv (RV.as_seq hh1 ihv) #pop-options private val insert_index_helper_even: lv:uint32_t{lv < merkle_tree_size_lg} -> j:index_t{U32.v j < pow2 (32 - U32.v lv) - 1} -> Lemma (requires (j % 2ul <> 1ul)) (ensures (U32.v j % 2 <> 1 /\ j / 2ul == (j + 1ul) / 2ul)) let insert_index_helper_even lv j = () #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" private val insert_index_helper_odd: lv:uint32_t{lv < merkle_tree_size_lg} -> i:index_t -> j:index_t{i <= j && U32.v j < pow2 (32 - U32.v lv) - 1} -> Lemma (requires (j % 2ul = 1ul /\ j < uint32_32_max)) (ensures (U32.v j % 2 = 1 /\ U32.v (j / 2ul) < pow2 (32 - U32.v (lv + 1ul)) - 1 /\ (j + 1ul) / 2ul == j / 2ul + 1ul /\ j - offset_of i > 0ul)) let insert_index_helper_odd lv i j = () #pop-options private val loc_union_assoc_4: a:loc -> b:loc -> c:loc -> d:loc -> Lemma (loc_union (loc_union a b) (loc_union c d) == loc_union (loc_union a c) (loc_union b d)) let loc_union_assoc_4 a b c d = loc_union_assoc (loc_union a b) c d; loc_union_assoc a b c; loc_union_assoc a c b; loc_union_assoc (loc_union a c) b d private val insert_modifies_rec_helper: #hsz:hash_size_t -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> aloc:loc -> h:HS.mem -> Lemma (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) aloc) (loc_union (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc) == loc_union (loc_union (RV.rv_loc_elems h hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) aloc) #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let insert_modifies_rec_helper #hsz lv hs aloc h = assert (V.loc_vector_within hs lv (V.size_of hs) == loc_union (V.loc_vector_within hs lv (lv + 1ul)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))); RV.rs_loc_elems_rec_inverse (hvreg hsz) (V.as_seq h hs) (U32.v lv) (U32.v (V.size_of hs)); assert (RV.rv_loc_elems h hs lv (V.size_of hs) == loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs))); // Applying some association rules... loc_union_assoc (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) aloc (loc_union (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc); loc_union_assoc (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc aloc; loc_union_assoc (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc; loc_union_assoc_4 (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul)) (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs)) #pop-options private val insert_modifies_union_loc_weakening: l1:loc -> l2:loc -> l3:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (modifies l1 h0 h1)) (ensures (modifies (loc_union (loc_union l1 l2) l3) h0 h1)) let insert_modifies_union_loc_weakening l1 l2 l3 h0 h1 = B.loc_includes_union_l l1 l2 l1; B.loc_includes_union_l (loc_union l1 l2) l3 (loc_union l1 l2) private val insert_snoc_last_helper: #a:Type -> s:S.seq a{S.length s > 0} -> v:a -> Lemma (S.index (S.snoc s v) (S.length s - 1) == S.last s) let insert_snoc_last_helper #a s v = () private val rv_inv_rv_elems_reg: #a:Type0 -> #rst:Type -> #rg:regional rst a -> h:HS.mem -> rv:rvector rg -> i:uint32_t -> j:uint32_t{i <= j && j <= V.size_of rv} -> Lemma (requires (RV.rv_inv h rv)) (ensures (RV.rv_elems_reg h rv i j)) let rv_inv_rv_elems_reg #a #rst #rg h rv i j = () // `insert_` recursively inserts proper hashes to each level `lv` by // accumulating a compressed hash. For example, if there are three leaf elements // in the tree, `insert_` will change `hs` as follow: // (`hij` is a compressed hash from `hi` to `hj`) // // BEFORE INSERTION AFTER INSERTION // lv // 0 h0 h1 h2 ====> h0 h1 h2 h3 // 1 h01 h01 h23 // 2 h03 // private val insert_: #hsz:hash_size_t -> #hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> acc:hash #hsz -> hash_fun:hash_fun_t #hsz #hash_spec -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 acc /\ HH.disjoint (V.frameOf hs) (B.frameOf acc) /\ mt_safe_elts h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (loc_union (RV.rv_loc_elems h0 hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 acc /\ mt_safe_elts h1 lv hs (Ghost.reveal i) (j + 1ul) /\ // correctness (mt_safe_elts_spec h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 acc))))) (decreases (U32.v j))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.New.High.fst.checked", "MerkleTree.Low.VectorExtras.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Seq.Properties.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperStack.fsti.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked", "FStar.All.fst.checked", "EverCrypt.Helpers.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.fst" }
[ { "abbrev": false, "full_module": "MerkleTree.Low.VectorExtras", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": true, "full_module": "MerkleTree.New.High", "short_module": "MTH" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "S" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperStack", "short_module": "MHS" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Buffer", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "FStar.All", "short_module": null }, { "abbrev": false, "full_module": "EverCrypt.Helpers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree", "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": 1, "initial_ifuel": 1, "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": 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": 800, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
lv: LowStar.Vector.uint32_t{lv < MerkleTree.Low.merkle_tree_size_lg} -> i: FStar.Ghost.erased MerkleTree.Low.index_t -> j: MerkleTree.Low.index_t { FStar.Ghost.reveal i <= j && FStar.UInt32.v j < Prims.pow2 (32 - FStar.UInt32.v lv) - 1 && j < MerkleTree.Low.uint32_32_max } -> hs: MerkleTree.Low.Datastructures.hash_vv hsz {LowStar.Vector.size_of hs = MerkleTree.Low.merkle_tree_size_lg} -> acc: MerkleTree.Low.Datastructures.hash -> hash_fun: MerkleTree.Low.Hashfunctions.hash_fun_t -> FStar.HyperStack.ST.ST Prims.unit
FStar.HyperStack.ST.ST
[ "" ]
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "FStar.Ghost.erased", "MerkleTree.Spec.hash_fun_t", "FStar.UInt32.v", "LowStar.Vector.uint32_t", "Prims.b2t", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "MerkleTree.Low.merkle_tree_size_lg", "MerkleTree.Low.index_t", "Prims.op_AmpAmp", "FStar.Integers.op_Less_Equals", "FStar.Ghost.reveal", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "FStar.Integers.op_Subtraction", "Prims.pow2", "MerkleTree.Low.uint32_32_max", "MerkleTree.Low.Datastructures.hash_vv", "Prims.op_Equality", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.Hashfunctions.hash_fun_t", "Prims._assert", "FStar.Seq.Base.equal", "LowStar.Regional.__proj__Rgl__item__repr", "MerkleTree.Low.Datastructures.hvreg", "LowStar.RVector.as_seq", "MerkleTree.New.High.insert_", "LowStar.Regional.__proj__Rgl__item__r_repr", "MerkleTree.Low.Datastructures.hreg", "Prims.unit", "MerkleTree.Low.mt_safe_elts_spec", "LowStar.Regional.__proj__Rgl__item__r_inv", "LowStar.RVector.rv_inv", "MerkleTree.Low.mt_safe_elts", "FStar.Integers.op_Plus", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.insert_modifies_rec_helper", "LowStar.Monotonic.Buffer.loc_all_regions_from", "LowStar.Monotonic.Buffer.frameOf", "Lib.IntTypes.uint8", "LowStar.Buffer.trivial_preorder", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_union", "LowStar.RVector.rs_loc_elem", "LowStar.Vector.as_seq", "LowStar.Vector.loc_vector_within", "LowStar.RVector.rv_loc_elems", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "FStar.UInt32.t", "FStar.Integers.op_Percent", "MerkleTree.New.High.insert_rec", "FStar.Integers.op_Slash", "MerkleTree.Low.mt_safe_elts_constr", "Prims.eq2", "LowStar.Vector.get", "MerkleTree.Low.offset_of", "LowStar.Vector.get_preserved", "LowStar.Monotonic.Buffer.loc_disjoint", "LowStar.RVector.rv_loc_elems_included", "MerkleTree.Low.rv_inv_rv_elems_reg", "MerkleTree.Low.insert_", "FStar.Ghost.hide", "FStar.Seq.Properties.last", "MerkleTree.New.High.hash", "FStar.Seq.Base.index", "MerkleTree.Low.insert_snoc_last_helper", "MerkleTree.Low.mt_safe_elts_preserved", "LowStar.Monotonic.Buffer.loc_region_only", "LowStar.RVector.rv_loc_elems_preserved", "LowStar.RVector.as_seq_preserved", "LowStar.RVector.rv_inv_preserved", "LowStar.Vector.index", "MerkleTree.Low.Datastructures.hash_vec_rv_inv_r_inv", "FStar.Integers.op_Greater", "Prims.int", "FStar.Seq.Base.length", "MerkleTree.Low.insert_index_helper_odd", "Prims.bool", "MerkleTree.New.High.insert_base", "MerkleTree.Low.insert_modifies_union_loc_weakening", "MerkleTree.Low.insert_index_helper_even", "LowStar.Vector.loc_vector_within_disjoint", "LowStar.Vector.loc_vector_within_included", "MerkleTree.Low.hash_vv_insert_copy" ]
[ "recursion" ]
false
true
false
false
false
let rec insert_ #hsz #hash_spec lv i j hs acc hash_fun =
let hh0 = HST.get () in hash_vv_insert_copy lv i j hs acc; let hh1 = HST.get () in V.loc_vector_within_included hs lv (lv + 1ul); V.loc_vector_within_included hs (lv + 1ul) (V.size_of hs); V.loc_vector_within_disjoint hs lv (lv + 1ul) (lv + 1ul) (V.size_of hs); assert (V.size_of (V.get hh1 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul)); if j % 2ul = 1ul then (insert_index_helper_odd lv (Ghost.reveal i) j; assert (S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) > 0); let lvhs = V.index hs lv in assert (U32.v (V.size_of lvhs) == S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) + 1); assert (V.size_of lvhs > 1ul); hash_vec_rv_inv_r_inv hh1 (V.get hh1 hs lv) (V.size_of (V.get hh1 hs lv) - 2ul); assert (Rgl?.r_inv (hreg hsz) hh1 acc); hash_fun (V.index lvhs (V.size_of lvhs - 2ul)) acc acc; let hh2 = HST.get () in assert (modifies (B.loc_all_regions_from false (B.frameOf acc)) hh1 hh2); assert (modifies (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh2); RV.rv_inv_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.as_seq_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; assert (RV.rv_inv hh2 hs); assert (Rgl?.r_inv (hreg hsz) hh2 acc); V.get_preserved hs lv (B.loc_region_only false (B.frameOf acc)) hh1 hh2; mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; insert_snoc_last_helper (RV.as_seq hh0 (V.get hh0 hs lv)) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (Rgl?.r_repr (hreg hsz) hh2 acc) ((Ghost.reveal hash_spec) (S.last (S.index (RV.as_seq hh0 hs) (U32.v lv))) (Rgl?.r_repr (hreg hsz) hh0 acc))); insert_ (lv + 1ul) (Ghost.hide (Ghost.reveal i / 2ul)) (j / 2ul) hs acc hash_fun; let hh3 = HST.get () in assert (RV.rv_inv hh3 hs); assert (Rgl?.r_inv (hreg hsz) hh3 acc); assert (modifies (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3); assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh3); rv_inv_rv_elems_reg hh2 hs (lv + 1ul) (V.size_of hs); RV.rv_loc_elems_included hh2 hs (lv + 1ul) (V.size_of hs); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (B.loc_all_regions_from false (B.frameOf acc))); V.get_preserved hs lv (loc_union (loc_union (V.loc_vector_within hs (lv + 1ul) (V.size_of hs)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3; assert (V.size_of (V.get hh3 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); assert (mt_safe_elts hh3 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul + 1ul)); mt_safe_elts_constr hh3 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh3 lv hs (Ghost.reveal i) (j + 1ul)); mt_safe_elts_spec hh2 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv + 1) (U32.v (Ghost.reveal i) / 2) (U32.v j / 2) (RV.as_seq hh2 hs) (Rgl?.r_repr (hreg hsz) hh2 acc))); mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_rec #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))) else (insert_index_helper_even lv j; assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) ((j + 1ul) / 2ul)); mt_safe_elts_constr hh1 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh1 lv hs (Ghost.reveal i) (j + 1ul)); assert (modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) hh0 hh1); insert_modifies_union_loc_weakening (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc)) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh1; mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_base #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh1 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))); let hh4 = HST.get () in assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh4); insert_modifies_rec_helper lv hs (B.loc_all_regions_from false (B.frameOf acc)) hh0; assert (mt_safe_elts hh4 lv hs (Ghost.reveal i) (j + 1ul)); assert (RV.rv_inv hh4 hs); assert (Rgl?.r_inv (hreg hsz) hh4 acc); mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; assert (S.equal (RV.as_seq hh4 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))
false
Vale.Curve25519.FastUtil_helpers.fst
Vale.Curve25519.FastUtil_helpers.pow2int_two
val pow2int_two (c0 c1: int) : int
val pow2int_two (c0 c1: int) : int
let pow2int_two (c0 c1:int) : int = c0 + c1 * pow2_64
{ "file_name": "vale/code/crypto/ecc/curve25519/Vale.Curve25519.FastUtil_helpers.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 53, "end_line": 47, "start_col": 0, "start_line": 47 }
module Vale.Curve25519.FastUtil_helpers open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Mul open FStar.Tactics open FStar.Tactics.CanonCommSemiring open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_internal (* let lemma_sub_carry_equiv (x y:nat64) (c:bit) : Lemma (let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () let lemma_sub_carry_equiv_forall () : Lemma (forall x y c . {:pattern (sub_carry x y c)} let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () *) #reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' \ --max_fuel 0 --max_ifuel 0 --z3rlimit 50" let lemma_sub2 (a:nat) (a0 a1:nat64) (b:nat) (b0 b1:nat64) (s1 s2:nat64) (c:bit) : Lemma (requires a = pow2_two a0 a1 /\ b = pow2_two b0 b1 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in s1 == s1' /\ s2 == s2' /\ c == c2)) (ensures a - b == pow2_two s1 s2 - c * pow2_128) = () // Unclear why lemma_sub2 passes, lemma_sub3 sometimes passed, sometimes ran forever (before we added explicit help), but lemma_sub4 fails without explicit help
{ "checked_file": "/", "dependencies": [ "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.Fast_lemmas_internal.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "FStar.Tactics.CanonCommSemiring.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.FastUtil_helpers.fst" }
[ { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_internal", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Vale.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": 2, "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c0: Prims.int -> c1: Prims.int -> Prims.int
Prims.Tot
[ "total" ]
[]
[ "Prims.int", "Prims.op_Addition", "FStar.Mul.op_Star", "Vale.Def.Words_s.pow2_64" ]
[]
false
false
false
true
false
let pow2int_two (c0 c1: int) : int =
c0 + c1 * pow2_64
false
Vale.Curve25519.FastUtil_helpers.fst
Vale.Curve25519.FastUtil_helpers.pow2int_three
val pow2int_three (c0 c1 c2: int) : int
val pow2int_three (c0 c1 c2: int) : int
let pow2int_three (c0 c1 c2:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128
{ "file_name": "vale/code/crypto/ecc/curve25519/Vale.Curve25519.FastUtil_helpers.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 74, "end_line": 48, "start_col": 0, "start_line": 48 }
module Vale.Curve25519.FastUtil_helpers open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Mul open FStar.Tactics open FStar.Tactics.CanonCommSemiring open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_internal (* let lemma_sub_carry_equiv (x y:nat64) (c:bit) : Lemma (let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () let lemma_sub_carry_equiv_forall () : Lemma (forall x y c . {:pattern (sub_carry x y c)} let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () *) #reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' \ --max_fuel 0 --max_ifuel 0 --z3rlimit 50" let lemma_sub2 (a:nat) (a0 a1:nat64) (b:nat) (b0 b1:nat64) (s1 s2:nat64) (c:bit) : Lemma (requires a = pow2_two a0 a1 /\ b = pow2_two b0 b1 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in s1 == s1' /\ s2 == s2' /\ c == c2)) (ensures a - b == pow2_two s1 s2 - c * pow2_128) = () // Unclear why lemma_sub2 passes, lemma_sub3 sometimes passed, sometimes ran forever (before we added explicit help), but lemma_sub4 fails without explicit help
{ "checked_file": "/", "dependencies": [ "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.Fast_lemmas_internal.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "FStar.Tactics.CanonCommSemiring.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.FastUtil_helpers.fst" }
[ { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_internal", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Vale.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": 2, "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c0: Prims.int -> c1: Prims.int -> c2: Prims.int -> Prims.int
Prims.Tot
[ "total" ]
[]
[ "Prims.int", "Prims.op_Addition", "FStar.Mul.op_Star", "Vale.Def.Words_s.pow2_64", "Vale.Def.Words_s.pow2_128" ]
[]
false
false
false
true
false
let pow2int_three (c0 c1 c2: int) : int =
c0 + c1 * pow2_64 + c2 * pow2_128
false
Vale.Curve25519.FastUtil_helpers.fst
Vale.Curve25519.FastUtil_helpers.pow2int_four
val pow2int_four (c0 c1 c2 c3: int) : int
val pow2int_four (c0 c1 c2 c3: int) : int
let pow2int_four (c0 c1 c2 c3:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128 + c3 * pow2_192
{ "file_name": "vale/code/crypto/ecc/curve25519/Vale.Curve25519.FastUtil_helpers.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 92, "end_line": 49, "start_col": 0, "start_line": 49 }
module Vale.Curve25519.FastUtil_helpers open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Mul open FStar.Tactics open FStar.Tactics.CanonCommSemiring open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_internal (* let lemma_sub_carry_equiv (x y:nat64) (c:bit) : Lemma (let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () let lemma_sub_carry_equiv_forall () : Lemma (forall x y c . {:pattern (sub_carry x y c)} let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () *) #reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' \ --max_fuel 0 --max_ifuel 0 --z3rlimit 50" let lemma_sub2 (a:nat) (a0 a1:nat64) (b:nat) (b0 b1:nat64) (s1 s2:nat64) (c:bit) : Lemma (requires a = pow2_two a0 a1 /\ b = pow2_two b0 b1 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in s1 == s1' /\ s2 == s2' /\ c == c2)) (ensures a - b == pow2_two s1 s2 - c * pow2_128) = () // Unclear why lemma_sub2 passes, lemma_sub3 sometimes passed, sometimes ran forever (before we added explicit help), but lemma_sub4 fails without explicit help let pow2int_two (c0 c1:int) : int = c0 + c1 * pow2_64
{ "checked_file": "/", "dependencies": [ "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.Fast_lemmas_internal.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "FStar.Tactics.CanonCommSemiring.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.FastUtil_helpers.fst" }
[ { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_internal", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Vale.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": 2, "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": 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": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c0: Prims.int -> c1: Prims.int -> c2: Prims.int -> c3: Prims.int -> Prims.int
Prims.Tot
[ "total" ]
[]
[ "Prims.int", "Prims.op_Addition", "FStar.Mul.op_Star", "Vale.Def.Words_s.pow2_64", "Vale.Def.Words_s.pow2_128", "Vale.Curve25519.Fast_defs.pow2_192" ]
[]
false
false
false
true
false
let pow2int_four (c0 c1 c2 c3: int) : int =
c0 + c1 * pow2_64 + c2 * pow2_128 + c3 * pow2_192
false
Hacl.Chacha20Poly1305_32.fst
Hacl.Chacha20Poly1305_32.encrypt
val encrypt:aead_encrypt_st M32
val encrypt:aead_encrypt_st M32
let encrypt : aead_encrypt_st M32 = chacha20poly1305_aead_encrypt_higher #M32 True poly1305_do_32 Hacl.Chacha20.chacha20_encrypt
{ "file_name": "code/chacha20poly1305/Hacl.Chacha20Poly1305_32.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 94, "end_line": 32, "start_col": 0, "start_line": 31 }
module Hacl.Chacha20Poly1305_32 open Hacl.Meta.Chacha20Poly1305 open Hacl.Impl.Chacha20Poly1305 open Hacl.Impl.Poly1305.Fields open Hacl.Poly1305_32 #set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0" [@CInline] private let poly1305_padded_32 = Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded #M32 [@CInline] private let poly1305_do_32 = chacha20poly1305_poly1305_do_higher #M32 True poly1305_finish poly1305_init poly1305_padded_32 [@@ Comment "Encrypt a message `input` with key `key`. The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. @param output Pointer to `input_len` bytes of memory where the ciphertext is written to. @param tag Pointer to 16 bytes of memory where the mac is written to. @param input Pointer to `input_len` bytes of memory where the message is read from. @param input_len Length of the message. @param data Pointer to `data_len` bytes of memory where the associated data is read from. @param data_len Length of the associated data. @param key Pointer to 32 bytes of memory where the AEAD key is read from.
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Poly1305_32.fsti.checked", "Hacl.Meta.Chacha20Poly1305.fst.checked", "Hacl.Impl.Poly1305.Fields.fst.checked", "Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked", "Hacl.Impl.Chacha20Poly1305.fst.checked", "Hacl.Chacha20.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Chacha20Poly1305_32.fst" }
[ { "abbrev": false, "full_module": "Hacl.Poly1305_32", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Meta.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": 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
Hacl.Impl.Chacha20Poly1305.aead_encrypt_st Hacl.Impl.Poly1305.Fields.M32
Prims.Tot
[ "total" ]
[]
[ "Hacl.Meta.Chacha20Poly1305.chacha20poly1305_aead_encrypt_higher", "Hacl.Impl.Poly1305.Fields.M32", "Prims.l_True", "Hacl.Chacha20Poly1305_32.poly1305_do_32", "Hacl.Chacha20.chacha20_encrypt" ]
[]
false
false
false
true
false
let encrypt:aead_encrypt_st M32 =
chacha20poly1305_aead_encrypt_higher #M32 True poly1305_do_32 Hacl.Chacha20.chacha20_encrypt
false
Hacl.Chacha20Poly1305_32.fst
Hacl.Chacha20Poly1305_32.poly1305_padded_32
val poly1305_padded_32 : Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded_st Hacl.Impl.Poly1305.Fields.M32
let poly1305_padded_32 = Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded #M32
{ "file_name": "code/chacha20poly1305/Hacl.Chacha20Poly1305_32.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 81, "end_line": 12, "start_col": 0, "start_line": 12 }
module Hacl.Chacha20Poly1305_32 open Hacl.Meta.Chacha20Poly1305 open Hacl.Impl.Chacha20Poly1305 open Hacl.Impl.Poly1305.Fields open Hacl.Poly1305_32 #set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0" [@CInline]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Poly1305_32.fsti.checked", "Hacl.Meta.Chacha20Poly1305.fst.checked", "Hacl.Impl.Poly1305.Fields.fst.checked", "Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked", "Hacl.Impl.Chacha20Poly1305.fst.checked", "Hacl.Chacha20.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Chacha20Poly1305_32.fst" }
[ { "abbrev": false, "full_module": "Hacl.Poly1305_32", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Meta.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": 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
Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded_st Hacl.Impl.Poly1305.Fields.M32
Prims.Tot
[ "total" ]
[]
[ "Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded", "Hacl.Impl.Poly1305.Fields.M32" ]
[]
false
false
false
true
false
let poly1305_padded_32 =
Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded #M32
false
Hacl.Chacha20Poly1305_32.fst
Hacl.Chacha20Poly1305_32.poly1305_do_32
val poly1305_do_32 : Hacl.Meta.Chacha20Poly1305.chacha20poly1305_poly1305_do_higher_t Prims.l_True
let poly1305_do_32 = chacha20poly1305_poly1305_do_higher #M32 True poly1305_finish poly1305_init poly1305_padded_32
{ "file_name": "code/chacha20poly1305/Hacl.Chacha20Poly1305_32.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 115, "end_line": 16, "start_col": 0, "start_line": 16 }
module Hacl.Chacha20Poly1305_32 open Hacl.Meta.Chacha20Poly1305 open Hacl.Impl.Chacha20Poly1305 open Hacl.Impl.Poly1305.Fields open Hacl.Poly1305_32 #set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0" [@CInline] private let poly1305_padded_32 = Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded #M32 [@CInline]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Poly1305_32.fsti.checked", "Hacl.Meta.Chacha20Poly1305.fst.checked", "Hacl.Impl.Poly1305.Fields.fst.checked", "Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked", "Hacl.Impl.Chacha20Poly1305.fst.checked", "Hacl.Chacha20.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Chacha20Poly1305_32.fst" }
[ { "abbrev": false, "full_module": "Hacl.Poly1305_32", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Meta.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": 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
Hacl.Meta.Chacha20Poly1305.chacha20poly1305_poly1305_do_higher_t Prims.l_True
Prims.Tot
[ "total" ]
[]
[ "Hacl.Meta.Chacha20Poly1305.chacha20poly1305_poly1305_do_higher", "Hacl.Impl.Poly1305.Fields.M32", "Prims.l_True", "Hacl.Poly1305_32.poly1305_finish", "Hacl.Poly1305_32.poly1305_init", "Hacl.Chacha20Poly1305_32.poly1305_padded_32" ]
[]
false
false
false
true
false
let poly1305_do_32 =
chacha20poly1305_poly1305_do_higher #M32 True poly1305_finish poly1305_init poly1305_padded_32
false
Hacl.Chacha20Poly1305_32.fst
Hacl.Chacha20Poly1305_32.decrypt
val decrypt:aead_decrypt_st M32
val decrypt:aead_decrypt_st M32
let decrypt : aead_decrypt_st M32 = chacha20poly1305_aead_decrypt_higher #M32 True Hacl.Chacha20.chacha20_encrypt poly1305_do_32
{ "file_name": "code/chacha20poly1305/Hacl.Chacha20Poly1305_32.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 94, "end_line": 53, "start_col": 0, "start_line": 52 }
module Hacl.Chacha20Poly1305_32 open Hacl.Meta.Chacha20Poly1305 open Hacl.Impl.Chacha20Poly1305 open Hacl.Impl.Poly1305.Fields open Hacl.Poly1305_32 #set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0" [@CInline] private let poly1305_padded_32 = Hacl.Impl.Chacha20Poly1305.PolyCore.poly1305_padded #M32 [@CInline] private let poly1305_do_32 = chacha20poly1305_poly1305_do_higher #M32 True poly1305_finish poly1305_init poly1305_padded_32 [@@ Comment "Encrypt a message `input` with key `key`. The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. @param output Pointer to `input_len` bytes of memory where the ciphertext is written to. @param tag Pointer to 16 bytes of memory where the mac is written to. @param input Pointer to `input_len` bytes of memory where the message is read from. @param input_len Length of the message. @param data Pointer to `data_len` bytes of memory where the associated data is read from. @param data_len Length of the associated data. @param key Pointer to 32 bytes of memory where the AEAD key is read from. @param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from."] let encrypt : aead_encrypt_st M32 = chacha20poly1305_aead_encrypt_higher #M32 True poly1305_do_32 Hacl.Chacha20.chacha20_encrypt [@@ Comment "Decrypt a ciphertext `input` with key `key`. The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. Note: Encryption and decryption can be executed in-place, i.e., `output` and `input` can point to the same memory. If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. If decryption fails, the array `output` remains unchanged and the function returns the error code 1. @param output Pointer to `input_len` bytes of memory where the message is written to. @param input Pointer to `input_len` bytes of memory where the ciphertext is read from. @param input_len Length of the ciphertext. @param data Pointer to `data_len` bytes of memory where the associated data is read from. @param data_len Length of the associated data. @param key Pointer to 32 bytes of memory where the AEAD key is read from. @param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. @param tag Pointer to 16 bytes of memory where the mac is read from.
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Hacl.Poly1305_32.fsti.checked", "Hacl.Meta.Chacha20Poly1305.fst.checked", "Hacl.Impl.Poly1305.Fields.fst.checked", "Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked", "Hacl.Impl.Chacha20Poly1305.fst.checked", "Hacl.Chacha20.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Chacha20Poly1305_32.fst" }
[ { "abbrev": false, "full_module": "Hacl.Poly1305_32", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Poly1305.Fields", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Impl.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Meta.Chacha20Poly1305", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": 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
Hacl.Impl.Chacha20Poly1305.aead_decrypt_st Hacl.Impl.Poly1305.Fields.M32
Prims.Tot
[ "total" ]
[]
[ "Hacl.Meta.Chacha20Poly1305.chacha20poly1305_aead_decrypt_higher", "Hacl.Impl.Poly1305.Fields.M32", "Prims.l_True", "Hacl.Chacha20.chacha20_encrypt", "Hacl.Chacha20Poly1305_32.poly1305_do_32" ]
[]
false
false
false
true
false
let decrypt:aead_decrypt_st M32 =
chacha20poly1305_aead_decrypt_higher #M32 True Hacl.Chacha20.chacha20_encrypt poly1305_do_32
false
FStar.Math.Fermat.fsti
FStar.Math.Fermat.pow
val pow (a: int) (k: nat) : int
val pow (a: int) (k: nat) : int
let rec pow (a:int) (k:nat) : int = if k = 0 then 1 else a * pow a (k - 1)
{ "file_name": "ulib/FStar.Math.Fermat.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 24, "end_line": 29, "start_col": 0, "start_line": 27 }
module FStar.Math.Fermat open FStar.Mul open FStar.Math.Euclid /// Fermat's Little Theorem (and Binomial Theorem) /// /// Proven by induction from the Freshman's dream identity /// /// pow (a + b) p % p = (pow a p + pow b p) % p /// /// which follows from the Binomial Theorem /// /// pow (a + b) n = sum_{i=0}^n (binomial n k * pow a (n - i) * pow b i) /// /// which in turn can be proved by induction from Pascal's identity /// /// binomial n k + binomial n (k - 1) = binomial (n + 1) k /// /// See /// https://github.com/coqtail/coqtail/blob/master/src/Hierarchy/Commutative_ring_binomial.v /// https://github.com/coq-contribs/rsa/blob/master/Binomials.v /// #set-options "--fuel 0 --ifuel 0"
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Euclid.fsti.checked" ], "interface_file": false, "source_file": "FStar.Math.Fermat.fsti" }
[ { "abbrev": false, "full_module": "FStar.Math.Euclid", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Math", "short_module": null }, { "abbrev": false, "full_module": "FStar.Math", "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": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Prims.int -> k: Prims.nat -> Prims.int
Prims.Tot
[ "total" ]
[]
[ "Prims.int", "Prims.nat", "Prims.op_Equality", "Prims.bool", "FStar.Mul.op_Star", "FStar.Math.Fermat.pow", "Prims.op_Subtraction" ]
[ "recursion" ]
false
false
false
true
false
let rec pow (a: int) (k: nat) : int =
if k = 0 then 1 else a * pow a (k - 1)
false
Vale.PPC64LE.Vecs.fst
Vale.PPC64LE.Vecs.equal
val equal (vecs1:t) (vecs2:t) : prop0
val equal (vecs1:t) (vecs2:t) : prop0
let equal vecs1 vecs2 = feq vecs1 vecs2
{ "file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Vecs.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 5, "start_col": 0, "start_line": 5 }
module Vale.PPC64LE.Vecs open Vale.PPC64LE.Machine_s open FStar.FunctionalExtensionality
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.Machine_s.fst.checked", "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FunctionalExtensionality.fsti.checked" ], "interface_file": true, "source_file": "Vale.PPC64LE.Vecs.fst" }
[ { "abbrev": false, "full_module": "FStar.FunctionalExtensionality", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Prop_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE", "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
vecs1: Vale.PPC64LE.Vecs.t -> vecs2: Vale.PPC64LE.Vecs.t -> Vale.Def.Prop_s.prop0
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.Vecs.t", "FStar.FunctionalExtensionality.feq", "Vale.PPC64LE.Machine_s.vec", "Vale.PPC64LE.Machine_s.quad32", "Vale.Def.Prop_s.prop0" ]
[]
false
false
false
true
false
let equal vecs1 vecs2 =
feq vecs1 vecs2
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.uint8_p
val uint8_p : Type0
let uint8_p = B.buffer UInt8.t
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 30, "end_line": 24, "start_col": 0, "start_line": 24 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.uint64
val uint64 : Prims.eqtype
let uint64 = UInt64.t
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 21, "end_line": 25, "start_col": 0, "start_line": 25 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.disjoint_or_eq
val disjoint_or_eq : b1: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> b2: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> Prims.logical
let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 65, "end_line": 27, "start_col": 0, "start_line": 27 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b1: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> b2: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> Prims.logical
Prims.Tot
[ "total" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "Prims.l_or", "LowStar.Monotonic.Buffer.disjoint", "FStar.UInt8.t", "LowStar.Buffer.trivial_preorder", "Prims.eq2", "Prims.logical" ]
[]
false
false
false
true
true
let disjoint_or_eq (b1 b2: uint8_p) =
B.disjoint b1 b2 \/ b1 == b2
false
Vale.Curve25519.FastUtil_helpers.fst
Vale.Curve25519.FastUtil_helpers.lemma_sub
val lemma_sub (a:nat) (a0 a1 a2 a3:nat64) (b:nat) (b0 b1 b2 b3:nat64) (s1 s2 s3 s4:nat64) (c:bit) : Lemma (requires a = pow2_four a0 a1 a2 a3 /\ b = pow2_four b0 b1 b2 b3 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ s4 == s4' /\ c == c4)) (ensures a - b == pow2_four s1 s2 s3 s4 - c * pow2_256)
val lemma_sub (a:nat) (a0 a1 a2 a3:nat64) (b:nat) (b0 b1 b2 b3:nat64) (s1 s2 s3 s4:nat64) (c:bit) : Lemma (requires a = pow2_four a0 a1 a2 a3 /\ b = pow2_four b0 b1 b2 b3 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ s4 == s4' /\ c == c4)) (ensures a - b == pow2_four s1 s2 s3 s4 - c * pow2_256)
let lemma_sub (a:nat) (a0 a1 a2 a3:nat64) (b:nat) (b0 b1 b2 b3:nat64) (s1 s2 s3 s4:nat64) (c:bit) : Lemma (requires a = pow2_four a0 a1 a2 a3 /\ b = pow2_four b0 b1 b2 b3 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ s4 == s4' /\ c == c4)) (ensures a - b == pow2_four s1 s2 s3 s4 - c * pow2_256) = let a_minus_b = a - b in assert_by_tactic (a_minus_b == pow2int_four (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3)) int_canon; let a_three = pow2_three a0 a1 a2 in let b_three = pow2_three b0 b1 b2 in let a3_minus_b3 = a_three - b_three in assert_by_tactic (a3_minus_b3 == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2)) int_canon; lemma_pow2_int_34 (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3); assert (pow2int_four (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3) == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2) + (a3 - b3) * pow2_192); assert (a_minus_b == a3_minus_b3 + (a3 - b3) * pow2_192); let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in lemma_sub3 a_three a0 a1 a2 b_three b0 b1 b2 s1 s2 s3 c3; assert (a3_minus_b3 = pow2_three s1 s2 s3 - c3 * pow2_192); assert (a_minus_b == pow2_three s1 s2 s3 + (a3 - b3 - c3) * pow2_192); assert_by_tactic ((a3 - b3 - c3) * pow2_192 == s4 * pow2_192 - c * pow2_256) int_canon; assert (a_minus_b == pow2_three s1 s2 s3 + s4 * pow2_192 - c * pow2_256); assert_by_tactic (pow2_three s1 s2 s3 + s4 * pow2_192 == pow2_four s1 s2 s3 s4) int_canon; ()
{ "file_name": "vale/code/crypto/ecc/curve25519/Vale.Curve25519.FastUtil_helpers.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 4, "end_line": 134, "start_col": 0, "start_line": 96 }
module Vale.Curve25519.FastUtil_helpers open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Mul open FStar.Tactics open FStar.Tactics.CanonCommSemiring open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_internal (* let lemma_sub_carry_equiv (x y:nat64) (c:bit) : Lemma (let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () let lemma_sub_carry_equiv_forall () : Lemma (forall x y c . {:pattern (sub_carry x y c)} let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () *) #reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' \ --max_fuel 0 --max_ifuel 0 --z3rlimit 50" let lemma_sub2 (a:nat) (a0 a1:nat64) (b:nat) (b0 b1:nat64) (s1 s2:nat64) (c:bit) : Lemma (requires a = pow2_two a0 a1 /\ b = pow2_two b0 b1 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in s1 == s1' /\ s2 == s2' /\ c == c2)) (ensures a - b == pow2_two s1 s2 - c * pow2_128) = () // Unclear why lemma_sub2 passes, lemma_sub3 sometimes passed, sometimes ran forever (before we added explicit help), but lemma_sub4 fails without explicit help let pow2int_two (c0 c1:int) : int = c0 + c1 * pow2_64 let pow2int_three (c0 c1 c2:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128 let pow2int_four (c0 c1 c2 c3:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128 + c3 * pow2_192 let lemma_pow2_int_23 (c0 c1 c2:int) : Lemma (pow2int_three c0 c1 c2 == pow2int_two c0 c1 + c2 * pow2_128) = () let lemma_pow2_int_34 (c0 c1 c2 c3:int) : Lemma (pow2int_four c0 c1 c2 c3 == pow2int_three c0 c1 c2 + c3 * pow2_192) = () #reset-options "--z3rlimit 30 --max_fuel 0 --max_ifuel 0" // Passes let lemma_sub3 (a:nat) (a0 a1 a2:nat64) (b:nat) (b0 b1 b2:nat64) (s1 s2 s3:nat64) (c:bit) : Lemma (requires a = pow2_three a0 a1 a2 /\ b = pow2_three b0 b1 b2 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3)) (ensures a - b == pow2_three s1 s2 s3 - c * pow2_192) = assert_by_tactic (a - b == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2)) int_canon; lemma_pow2_int_23 (a0 - b0) (a1 - b1) (a2 - b2); let a_two = pow2_two a0 a1 in let b_two = pow2_two b0 b1 in let a_minus_b_two = a_two - b_two in assert_by_tactic (a_minus_b_two == pow2int_two (a0 - b0) (a1 - b1)) int_canon; let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in lemma_sub2 a_two a0 a1 b_two b0 b1 s1 s2 c2; assert_by_tactic ((a2 - b2 - c2) * pow2_128 == s3 * pow2_128 - c * pow2_192) int_canon; assert_by_tactic (pow2_two s1 s2 + s3 * pow2_128 == pow2_three s1 s2 s3) int_canon; () //
{ "checked_file": "/", "dependencies": [ "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.Fast_lemmas_internal.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "FStar.Tactics.CanonCommSemiring.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.FastUtil_helpers.fst" }
[ { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_internal", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Vale.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": 2, "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": 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": 30, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Prims.nat -> a0: Vale.Def.Types_s.nat64 -> a1: Vale.Def.Types_s.nat64 -> a2: Vale.Def.Types_s.nat64 -> a3: Vale.Def.Types_s.nat64 -> b: Prims.nat -> b0: Vale.Def.Types_s.nat64 -> b1: Vale.Def.Types_s.nat64 -> b2: Vale.Def.Types_s.nat64 -> b3: Vale.Def.Types_s.nat64 -> s1: Vale.Def.Types_s.nat64 -> s2: Vale.Def.Types_s.nat64 -> s3: Vale.Def.Types_s.nat64 -> s4: Vale.Def.Types_s.nat64 -> c: Vale.Curve25519.Fast_defs.bit -> FStar.Pervasives.Lemma (requires a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 /\ b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 /\ (let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a0 b0 0 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s1' c1 = _ in let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a1 b1 c1 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s2' c2 = _ in let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a2 b2 c2 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s3' c3 = _ in let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a3 b3 c3 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s4' c4 = _ in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ s4 == s4' /\ c == c4) <: Prims.logical) <: Prims.logical) <: Prims.logical) <: Prims.logical)) (ensures a - b == Vale.Curve25519.Fast_defs.pow2_four s1 s2 s3 s4 - c * Vale.Curve25519.Fast_defs.pow2_256)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Prims.nat", "Vale.Def.Types_s.nat64", "Vale.Curve25519.Fast_defs.bit", "Prims.unit", "FStar.Tactics.Effect.assert_by_tactic", "Prims.eq2", "Prims.int", "Prims.op_Addition", "Vale.Curve25519.Fast_defs.pow2_three", "FStar.Mul.op_Star", "Vale.Curve25519.Fast_defs.pow2_192", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Curve25519.FastUtil_helpers.int_canon", "Prims._assert", "Prims.op_Subtraction", "Vale.Curve25519.Fast_defs.pow2_256", "Prims.b2t", "Prims.op_Equality", "Vale.Curve25519.FastUtil_helpers.lemma_sub3", "FStar.Pervasives.Native.tuple2", "Vale.Def.Words_s.nat64", "Vale.Curve25519.FastUtil_helpers.sub_carry", "Vale.Curve25519.FastUtil_helpers.pow2int_four", "Vale.Curve25519.FastUtil_helpers.pow2int_three", "Vale.Curve25519.FastUtil_helpers.lemma_pow2_int_34", "Prims.l_and", "Prims.logical", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
false
false
true
false
false
let lemma_sub (a: nat) (a0 a1 a2 a3: nat64) (b: nat) (b0 b1 b2 b3 s1 s2 s3 s4: nat64) (c: bit) : Lemma (requires a = pow2_four a0 a1 a2 a3 /\ b = pow2_four b0 b1 b2 b3 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ s4 == s4' /\ c == c4)) (ensures a - b == pow2_four s1 s2 s3 s4 - c * pow2_256) =
let a_minus_b = a - b in assert_by_tactic (a_minus_b == pow2int_four (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3)) int_canon; let a_three = pow2_three a0 a1 a2 in let b_three = pow2_three b0 b1 b2 in let a3_minus_b3 = a_three - b_three in assert_by_tactic (a3_minus_b3 == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2)) int_canon; lemma_pow2_int_34 (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3); assert (pow2int_four (a0 - b0) (a1 - b1) (a2 - b2) (a3 - b3) == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2) + (a3 - b3) * pow2_192); assert (a_minus_b == a3_minus_b3 + (a3 - b3) * pow2_192); let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in let s4', c4 = sub_carry a3 b3 c3 in lemma_sub3 a_three a0 a1 a2 b_three b0 b1 b2 s1 s2 s3 c3; assert (a3_minus_b3 = pow2_three s1 s2 s3 - c3 * pow2_192); assert (a_minus_b == pow2_three s1 s2 s3 + (a3 - b3 - c3) * pow2_192); assert_by_tactic ((a3 - b3 - c3) * pow2_192 == s4 * pow2_192 - c * pow2_256) int_canon; assert (a_minus_b == pow2_three s1 s2 s3 + s4 * pow2_192 - c * pow2_256); assert_by_tactic (pow2_three s1 s2 s3 + s4 * pow2_192 == pow2_four s1 s2 s3 s4) int_canon; ()
false
Vale.Curve25519.FastUtil_helpers.fst
Vale.Curve25519.FastUtil_helpers.lemma_sub3
val lemma_sub3 (a:nat) (a0 a1 a2:nat64) (b:nat) (b0 b1 b2:nat64) (s1 s2 s3:nat64) (c:bit) : Lemma (requires a = pow2_three a0 a1 a2 /\ b = pow2_three b0 b1 b2 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3)) (ensures a - b == pow2_three s1 s2 s3 - c * pow2_192)
val lemma_sub3 (a:nat) (a0 a1 a2:nat64) (b:nat) (b0 b1 b2:nat64) (s1 s2 s3:nat64) (c:bit) : Lemma (requires a = pow2_three a0 a1 a2 /\ b = pow2_three b0 b1 b2 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3)) (ensures a - b == pow2_three s1 s2 s3 - c * pow2_192)
let lemma_sub3 (a:nat) (a0 a1 a2:nat64) (b:nat) (b0 b1 b2:nat64) (s1 s2 s3:nat64) (c:bit) : Lemma (requires a = pow2_three a0 a1 a2 /\ b = pow2_three b0 b1 b2 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3)) (ensures a - b == pow2_three s1 s2 s3 - c * pow2_192) = assert_by_tactic (a - b == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2)) int_canon; lemma_pow2_int_23 (a0 - b0) (a1 - b1) (a2 - b2); let a_two = pow2_two a0 a1 in let b_two = pow2_two b0 b1 in let a_minus_b_two = a_two - b_two in assert_by_tactic (a_minus_b_two == pow2int_two (a0 - b0) (a1 - b1)) int_canon; let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in lemma_sub2 a_two a0 a1 b_two b0 b1 s1 s2 c2; assert_by_tactic ((a2 - b2 - c2) * pow2_128 == s3 * pow2_128 - c * pow2_192) int_canon; assert_by_tactic (pow2_two s1 s2 + s3 * pow2_128 == pow2_three s1 s2 s3) int_canon; ()
{ "file_name": "vale/code/crypto/ecc/curve25519/Vale.Curve25519.FastUtil_helpers.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 4, "end_line": 92, "start_col": 0, "start_line": 63 }
module Vale.Curve25519.FastUtil_helpers open Vale.Def.Words_s open Vale.Def.Types_s open FStar.Mul open FStar.Tactics open FStar.Tactics.CanonCommSemiring open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_internal (* let lemma_sub_carry_equiv (x y:nat64) (c:bit) : Lemma (let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () let lemma_sub_carry_equiv_forall () : Lemma (forall x y c . {:pattern (sub_carry x y c)} let v, c' = sub_carry x y c in v == (x - (y + c)) % pow2_64 /\ c' == bool_bit (x - (y+c) < 0)) = () *) #reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' \ --max_fuel 0 --max_ifuel 0 --z3rlimit 50" let lemma_sub2 (a:nat) (a0 a1:nat64) (b:nat) (b0 b1:nat64) (s1 s2:nat64) (c:bit) : Lemma (requires a = pow2_two a0 a1 /\ b = pow2_two b0 b1 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in s1 == s1' /\ s2 == s2' /\ c == c2)) (ensures a - b == pow2_two s1 s2 - c * pow2_128) = () // Unclear why lemma_sub2 passes, lemma_sub3 sometimes passed, sometimes ran forever (before we added explicit help), but lemma_sub4 fails without explicit help let pow2int_two (c0 c1:int) : int = c0 + c1 * pow2_64 let pow2int_three (c0 c1 c2:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128 let pow2int_four (c0 c1 c2 c3:int) : int = c0 + c1 * pow2_64 + c2 * pow2_128 + c3 * pow2_192 let lemma_pow2_int_23 (c0 c1 c2:int) : Lemma (pow2int_three c0 c1 c2 == pow2int_two c0 c1 + c2 * pow2_128) = () let lemma_pow2_int_34 (c0 c1 c2 c3:int) : Lemma (pow2int_four c0 c1 c2 c3 == pow2int_three c0 c1 c2 + c3 * pow2_192) = () #reset-options "--z3rlimit 30 --max_fuel 0 --max_ifuel 0"
{ "checked_file": "/", "dependencies": [ "Vale.Def.Words_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.Fast_lemmas_internal.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "FStar.Tactics.CanonCommSemiring.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.FastUtil_helpers.fst" }
[ { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_internal", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics.CanonCommSemiring", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Vale.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": 2, "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": 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": 30, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Prims.nat -> a0: Vale.Def.Types_s.nat64 -> a1: Vale.Def.Types_s.nat64 -> a2: Vale.Def.Types_s.nat64 -> b: Prims.nat -> b0: Vale.Def.Types_s.nat64 -> b1: Vale.Def.Types_s.nat64 -> b2: Vale.Def.Types_s.nat64 -> s1: Vale.Def.Types_s.nat64 -> s2: Vale.Def.Types_s.nat64 -> s3: Vale.Def.Types_s.nat64 -> c: Vale.Curve25519.Fast_defs.bit -> FStar.Pervasives.Lemma (requires a = Vale.Curve25519.Fast_defs.pow2_three a0 a1 a2 /\ b = Vale.Curve25519.Fast_defs.pow2_three b0 b1 b2 /\ (let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a0 b0 0 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s1' c1 = _ in let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a1 b1 c1 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s2' c2 = _ in let _ = Vale.Curve25519.FastUtil_helpers.sub_carry a2 b2 c2 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ s3' c3 = _ in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3) <: Prims.logical) <: Prims.logical) <: Prims.logical)) (ensures a - b == Vale.Curve25519.Fast_defs.pow2_three s1 s2 s3 - c * Vale.Curve25519.Fast_defs.pow2_192)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Prims.nat", "Vale.Def.Types_s.nat64", "Vale.Curve25519.Fast_defs.bit", "Prims.unit", "FStar.Tactics.Effect.assert_by_tactic", "Prims.eq2", "Prims.int", "Prims.op_Addition", "Vale.Curve25519.Fast_defs.pow2_two", "FStar.Mul.op_Star", "Vale.Def.Words_s.pow2_128", "Vale.Curve25519.Fast_defs.pow2_three", "Vale.Curve25519.FastUtil_helpers.int_canon", "Prims.op_Subtraction", "Vale.Curve25519.Fast_defs.pow2_192", "Vale.Curve25519.FastUtil_helpers.lemma_sub2", "FStar.Pervasives.Native.tuple2", "Vale.Def.Words_s.nat64", "Vale.Curve25519.FastUtil_helpers.sub_carry", "Vale.Curve25519.FastUtil_helpers.pow2int_two", "Vale.Curve25519.FastUtil_helpers.lemma_pow2_int_23", "Vale.Curve25519.FastUtil_helpers.pow2int_three", "Prims.l_and", "Prims.b2t", "Prims.op_Equality", "Prims.logical", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
false
false
true
false
false
let lemma_sub3 (a: nat) (a0 a1 a2: nat64) (b: nat) (b0 b1 b2 s1 s2 s3: nat64) (c: bit) : Lemma (requires a = pow2_three a0 a1 a2 /\ b = pow2_three b0 b1 b2 /\ (let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in s1 == s1' /\ s2 == s2' /\ s3 == s3' /\ c == c3)) (ensures a - b == pow2_three s1 s2 s3 - c * pow2_192) =
assert_by_tactic (a - b == pow2int_three (a0 - b0) (a1 - b1) (a2 - b2)) int_canon; lemma_pow2_int_23 (a0 - b0) (a1 - b1) (a2 - b2); let a_two = pow2_two a0 a1 in let b_two = pow2_two b0 b1 in let a_minus_b_two = a_two - b_two in assert_by_tactic (a_minus_b_two == pow2int_two (a0 - b0) (a1 - b1)) int_canon; let s1', c1 = sub_carry a0 b0 0 in let s2', c2 = sub_carry a1 b1 c1 in let s3', c3 = sub_carry a2 b2 c2 in lemma_sub2 a_two a0 a1 b_two b0 b1 s1 s2 c2; assert_by_tactic ((a2 - b2 - c2) * pow2_128 == s3 * pow2_128 - c * pow2_192) int_canon; assert_by_tactic (pow2_two s1 s2 + s3 * pow2_128 == pow2_three s1 s2 s3) int_canon; ()
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.length_aux3
val length_aux3 (b: uint8_p) (n: nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0)
val length_aux3 (b: uint8_p) (n: nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0)
let length_aux3 (b:uint8_p) (n:nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 41, "end_line": 46, "start_col": 0, "start_line": 41 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> n: Prims.nat -> FStar.Pervasives.Lemma (requires LowStar.Monotonic.Buffer.length b = 16 * n) (ensures LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) % 16 = 0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "Prims.nat", "FStar.Math.Lemmas.cancel_mul_mod", "Prims.unit", "LowStar.BufferView.Down.length_eq", "FStar.UInt8.t", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview", "Vale.Arch.HeapTypes_s.TUInt8", "LowStar.Buffer.trivial_preorder", "Prims.b2t", "Prims.op_Equality", "Prims.int", "LowStar.Monotonic.Buffer.length", "FStar.Mul.op_Star", "Prims.squash", "Prims.op_Modulus", "LowStar.BufferView.Down.length", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let length_aux3 (b: uint8_p) (n: nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) =
let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.length_aux4
val length_aux4 (b: uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0)
val length_aux4 (b: uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0)
let length_aux4 (b:uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 19, "end_line": 52, "start_col": 0, "start_line": 48 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux3 (b:uint8_p) (n:nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> FStar.Pervasives.Lemma (requires LowStar.Monotonic.Buffer.length b = 16) (ensures LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) % 16 = 0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "LowStar.BufferView.Down.length_eq", "FStar.UInt8.t", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview", "Vale.Arch.HeapTypes_s.TUInt8", "LowStar.Buffer.trivial_preorder", "Prims.unit", "Prims.b2t", "Prims.op_Equality", "Prims.int", "LowStar.Monotonic.Buffer.length", "Prims.squash", "Prims.op_Modulus", "LowStar.BufferView.Down.length", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let length_aux4 (b: uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0) =
let db = get_downview b in DV.length_eq db
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.length_aux2
val length_aux2 (b: uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0)
val length_aux2 (b: uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0)
let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 19, "end_line": 39, "start_col": 0, "start_line": 35 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> FStar.Pervasives.Lemma (requires LowStar.Monotonic.Buffer.length b = 240) (ensures LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) % 16 = 0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "LowStar.BufferView.Down.length_eq", "FStar.UInt8.t", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview", "Vale.Arch.HeapTypes_s.TUInt8", "LowStar.Buffer.trivial_preorder", "Prims.unit", "Prims.b2t", "Prims.op_Equality", "Prims.int", "LowStar.Monotonic.Buffer.length", "Prims.squash", "Prims.op_Modulus", "LowStar.BufferView.Down.length", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let length_aux2 (b: uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) =
let db = get_downview b in DV.length_eq db
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.length_aux
val length_aux (b: uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0)
val length_aux (b: uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0)
let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 19, "end_line": 33, "start_col": 0, "start_line": 29 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> FStar.Pervasives.Lemma (requires LowStar.Monotonic.Buffer.length b = 176) (ensures LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) % 16 = 0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "LowStar.BufferView.Down.length_eq", "FStar.UInt8.t", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview", "Vale.Arch.HeapTypes_s.TUInt8", "LowStar.Buffer.trivial_preorder", "Prims.unit", "Prims.b2t", "Prims.op_Equality", "Prims.int", "LowStar.Monotonic.Buffer.length", "Prims.squash", "Prims.op_Modulus", "LowStar.BufferView.Down.length", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let length_aux (b: uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) =
let db = get_downview b in DV.length_eq db
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.length_aux5
val length_aux5 (b: uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0)
val length_aux5 (b: uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0)
let length_aux5 (b:uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 19, "end_line": 58, "start_col": 0, "start_line": 54 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux3 (b:uint8_p) (n:nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16 let length_aux4 (b:uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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
b: Vale.Wrapper.X64.GCMdecryptOpt.uint8_p -> FStar.Pervasives.Lemma (requires LowStar.Monotonic.Buffer.length b = 128) (ensures LowStar.BufferView.Down.length (Vale.Interop.Types.get_downview b) % 16 = 0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "LowStar.BufferView.Down.length_eq", "FStar.UInt8.t", "LowStar.BufferView.Down.buffer", "Vale.Interop.Types.get_downview", "Vale.Arch.HeapTypes_s.TUInt8", "LowStar.Buffer.trivial_preorder", "Prims.unit", "Prims.b2t", "Prims.op_Equality", "Prims.int", "LowStar.Monotonic.Buffer.length", "Prims.squash", "Prims.op_Modulus", "LowStar.BufferView.Down.length", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let length_aux5 (b: uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0) =
let db = get_downview b in DV.length_eq db
false
MerkleTree.Low.fst
MerkleTree.Low.mt_make_path_step
val mt_make_path_step: #hsz:hash_size_t -> lv:uint32_t{lv <= merkle_tree_size_lg} -> mtr:HH.rid -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> rhs:hash_vec #hsz {V.size_of rhs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j <> 0ul /\ i <= j /\ U32.v j < pow2 (32 - U32.v lv)} -> k:index_t{i <= k && k <= j} -> p:path_p -> actd:bool -> HST.ST unit (requires (fun h0 -> HH.includes mtr (V.frameOf hs) /\ HH.includes mtr (V.frameOf rhs) /\ RV.rv_inv h0 hs /\ RV.rv_inv h0 rhs /\ mt_safe_elts h0 lv hs i j /\ path_safe h0 mtr p /\ Path?.hash_size (B.get h0 p 0) = hsz /\ V.size_of (phashes h0 p) <= lv + 1ul)) (ensures (fun h0 _ h1 -> // memory safety modifies (path_loc p) h0 h1 /\ path_safe h1 mtr p /\ V.size_of (phashes h1 p) == V.size_of (phashes h0 p) + mt_path_length_step k j actd /\ V.size_of (phashes h1 p) <= lv + 2ul /\ // correctness (mt_safe_elts_spec h0 lv hs i j; (let hsz0 = Path?.hash_size (B.get h0 p 0) in let hsz1 = Path?.hash_size (B.get h1 p 0) in let before:(S.seq (MTH.hash #(U32.v hsz0))) = lift_path h0 mtr p in let after:(S.seq (MTH.hash #(U32.v hsz1))) = lift_path h1 mtr p in hsz = hsz0 /\ hsz = hsz1 /\ S.equal after (MTH.mt_make_path_step (U32.v lv) (RV.as_seq h0 hs) (RV.as_seq h0 rhs) (U32.v i) (U32.v j) (U32.v k) before actd)))))
val mt_make_path_step: #hsz:hash_size_t -> lv:uint32_t{lv <= merkle_tree_size_lg} -> mtr:HH.rid -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> rhs:hash_vec #hsz {V.size_of rhs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j <> 0ul /\ i <= j /\ U32.v j < pow2 (32 - U32.v lv)} -> k:index_t{i <= k && k <= j} -> p:path_p -> actd:bool -> HST.ST unit (requires (fun h0 -> HH.includes mtr (V.frameOf hs) /\ HH.includes mtr (V.frameOf rhs) /\ RV.rv_inv h0 hs /\ RV.rv_inv h0 rhs /\ mt_safe_elts h0 lv hs i j /\ path_safe h0 mtr p /\ Path?.hash_size (B.get h0 p 0) = hsz /\ V.size_of (phashes h0 p) <= lv + 1ul)) (ensures (fun h0 _ h1 -> // memory safety modifies (path_loc p) h0 h1 /\ path_safe h1 mtr p /\ V.size_of (phashes h1 p) == V.size_of (phashes h0 p) + mt_path_length_step k j actd /\ V.size_of (phashes h1 p) <= lv + 2ul /\ // correctness (mt_safe_elts_spec h0 lv hs i j; (let hsz0 = Path?.hash_size (B.get h0 p 0) in let hsz1 = Path?.hash_size (B.get h1 p 0) in let before:(S.seq (MTH.hash #(U32.v hsz0))) = lift_path h0 mtr p in let after:(S.seq (MTH.hash #(U32.v hsz1))) = lift_path h1 mtr p in hsz = hsz0 /\ hsz = hsz1 /\ S.equal after (MTH.mt_make_path_step (U32.v lv) (RV.as_seq h0 hs) (RV.as_seq h0 rhs) (U32.v i) (U32.v j) (U32.v k) before actd)))))
let mt_make_path_step #hsz lv mtr hs rhs i j k p actd = let pth = !*p in let hh0 = HST.get () in let ofs = offset_of i in if k % 2ul = 1ul then begin hash_vv_rv_inv_includes hh0 hs lv (k - 1ul - ofs); assert (HH.includes mtr (B.frameOf (V.get hh0 (V.get hh0 hs lv) (k - 1ul - ofs)))); assert(Path?.hash_size pth = hsz); mt_path_insert #hsz mtr p (V.index (V.index hs lv) (k - 1ul - ofs)) end else begin if k = j then () else if k + 1ul = j then (if actd then (assert (HH.includes mtr (B.frameOf (V.get hh0 rhs lv))); mt_path_insert mtr p (V.index rhs lv))) else (hash_vv_rv_inv_includes hh0 hs lv (k + 1ul - ofs); assert (HH.includes mtr (B.frameOf (V.get hh0 (V.get hh0 hs lv) (k + 1ul - ofs)))); mt_path_insert mtr p (V.index (V.index hs lv) (k + 1ul - ofs))) end
{ "file_name": "src/MerkleTree.Low.fst", "git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
{ "end_col": 5, "end_line": 1849, "start_col": 0, "start_line": 1827 }
module MerkleTree.Low open EverCrypt.Helpers open FStar.All open FStar.Integers open FStar.Mul open LowStar.Buffer open LowStar.BufferOps open LowStar.Vector open LowStar.Regional open LowStar.RVector open LowStar.Regional.Instances module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module MHS = FStar.Monotonic.HyperStack module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module S = FStar.Seq module U32 = FStar.UInt32 module U64 = FStar.UInt64 module MTH = MerkleTree.New.High module MTS = MerkleTree.Spec open Lib.IntTypes open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions open MerkleTree.Low.VectorExtras #set-options "--z3rlimit 10 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" type const_pointer (a:Type0) = b:CB.const_buffer a{CB.length b == 1 /\ CB.qual_of b == CB.MUTABLE} /// Low-level Merkle tree data structure /// // NOTE: because of a lack of 64-bit LowStar.Buffer support, currently // we cannot change below to some other types. type index_t = uint32_t let uint32_32_max = 4294967295ul inline_for_extraction let uint32_max = 4294967295UL let uint64_max = 18446744073709551615UL let offset_range_limit = uint32_max type offset_t = uint64_t inline_for_extraction noextract unfold let u32_64 = Int.Cast.uint32_to_uint64 inline_for_extraction noextract unfold let u64_32 = Int.Cast.uint64_to_uint32 private inline_for_extraction let offsets_connect (x:offset_t) (y:offset_t): Tot bool = y >= x && (y - x) <= offset_range_limit private inline_for_extraction let split_offset (tree:offset_t) (index:offset_t{offsets_connect tree index}): Tot index_t = [@inline_let] let diff = U64.sub_mod index tree in assert (diff <= offset_range_limit); Int.Cast.uint64_to_uint32 diff private inline_for_extraction let add64_fits (x:offset_t) (i:index_t): Tot bool = uint64_max - x >= (u32_64 i) private inline_for_extraction let join_offset (tree:offset_t) (i:index_t{add64_fits tree i}): Tot (r:offset_t{offsets_connect tree r}) = U64.add tree (u32_64 i) inline_for_extraction val merkle_tree_size_lg: uint32_t let merkle_tree_size_lg = 32ul // A Merkle tree `MT i j hs rhs_ok rhs` stores all necessary hashes to generate // a Merkle path for each element from the index `i` to `j-1`. // - Parameters // `hs`: a 2-dim store for hashes, where `hs[0]` contains leaf hash values. // `rhs_ok`: to check the rightmost hashes are up-to-date // `rhs`: a store for "rightmost" hashes, manipulated only when required to // calculate some merkle paths that need the rightmost hashes // as a part of them. // `mroot`: during the construction of `rhs` we can also calculate the Merkle // root of the tree. If `rhs_ok` is true then it has the up-to-date // root value. noeq type merkle_tree = | MT: hash_size:hash_size_t -> offset:offset_t -> i:index_t -> j:index_t{i <= j /\ add64_fits offset j} -> hs:hash_vv hash_size {V.size_of hs = merkle_tree_size_lg} -> rhs_ok:bool -> rhs:hash_vec #hash_size {V.size_of rhs = merkle_tree_size_lg} -> mroot:hash #hash_size -> hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hash_size)) -> hash_fun:hash_fun_t #hash_size #hash_spec -> merkle_tree type mt_p = B.pointer merkle_tree type const_mt_p = const_pointer merkle_tree inline_for_extraction let merkle_tree_conditions (#hsz:Ghost.erased hash_size_t) (offset:uint64_t) (i j:uint32_t) (hs:hash_vv hsz) (rhs_ok:bool) (rhs:hash_vec #hsz) (mroot:hash #hsz): Tot bool = j >= i && add64_fits offset j && V.size_of hs = merkle_tree_size_lg && V.size_of rhs = merkle_tree_size_lg // The maximum number of currently held elements in the tree is (2^32 - 1). // cwinter: even when using 64-bit indices, we fail if the underlying 32-bit // vector is full; this can be fixed if necessary. private inline_for_extraction val mt_not_full_nst: mtv:merkle_tree -> Tot bool let mt_not_full_nst mtv = MT?.j mtv < uint32_32_max val mt_not_full: HS.mem -> mt_p -> GTot bool let mt_not_full h mt = mt_not_full_nst (B.get h mt 0) /// (Memory) Safety val offset_of: i:index_t -> Tot index_t let offset_of i = if i % 2ul = 0ul then i else i - 1ul // `mt_safe_elts` says that it is safe to access an element from `i` to `j - 1` // at level `lv` in the Merkle tree, i.e., hs[lv][k] (i <= k < j) is a valid // element. inline_for_extraction noextract val mt_safe_elts: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> GTot Type0 (decreases (32 - U32.v lv)) let rec mt_safe_elts #hsz h lv hs i j = if lv = merkle_tree_size_lg then true else (let ofs = offset_of i in V.size_of (V.get h hs lv) == j - ofs /\ mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul)) #push-options "--initial_fuel 1 --max_fuel 1" val mt_safe_elts_constr: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (V.size_of (V.get h hs lv) == j - offset_of i /\ mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul))) (ensures (mt_safe_elts #hsz h lv hs i j)) let mt_safe_elts_constr #_ h lv hs i j = () val mt_safe_elts_head: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (mt_safe_elts #hsz h lv hs i j)) (ensures (V.size_of (V.get h hs lv) == j - offset_of i)) let mt_safe_elts_head #_ h lv hs i j = () val mt_safe_elts_rec: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (mt_safe_elts #hsz h lv hs i j)) (ensures (mt_safe_elts #hsz h (lv + 1ul) hs (i / 2ul) (j / 2ul))) let mt_safe_elts_rec #_ h lv hs i j = () val mt_safe_elts_init: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> Lemma (requires (V.forall_ h hs lv (V.size_of hs) (fun hv -> V.size_of hv = 0ul))) (ensures (mt_safe_elts #hsz h lv hs 0ul 0ul)) (decreases (32 - U32.v lv)) let rec mt_safe_elts_init #hsz h lv hs = if lv = merkle_tree_size_lg then () else mt_safe_elts_init #hsz h (lv + 1ul) hs #pop-options val mt_safe_elts_preserved: #hsz:hash_size_t -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (V.live h0 hs /\ mt_safe_elts #hsz h0 lv hs i j /\ loc_disjoint p (V.loc_vector_within hs lv (V.size_of hs)) /\ modifies p h0 h1)) (ensures (mt_safe_elts #hsz h1 lv hs i j)) (decreases (32 - U32.v lv)) [SMTPat (V.live h0 hs); SMTPat (mt_safe_elts #hsz h0 lv hs i j); SMTPat (loc_disjoint p (RV.loc_rvector hs)); SMTPat (modifies p h0 h1)] #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let rec mt_safe_elts_preserved #hsz lv hs i j p h0 h1 = if lv = merkle_tree_size_lg then () else (V.get_preserved hs lv p h0 h1; mt_safe_elts_preserved #hsz (lv + 1ul) hs (i / 2ul) (j / 2ul) p h0 h1) #pop-options // `mt_safe` is the invariant of a Merkle tree through its lifetime. // It includes liveness, regionality, disjointness (to each data structure), // and valid element access (`mt_safe_elts`). inline_for_extraction noextract val mt_safe: HS.mem -> mt_p -> GTot Type0 let mt_safe h mt = B.live h mt /\ B.freeable mt /\ (let mtv = B.get h mt 0 in // Liveness & Accessibility RV.rv_inv h (MT?.hs mtv) /\ RV.rv_inv h (MT?.rhs mtv) /\ Rgl?.r_inv (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv) /\ mt_safe_elts h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv) /\ // Regionality HH.extends (V.frameOf (MT?.hs mtv)) (B.frameOf mt) /\ HH.extends (V.frameOf (MT?.rhs mtv)) (B.frameOf mt) /\ HH.extends (B.frameOf (MT?.mroot mtv)) (B.frameOf mt) /\ HH.disjoint (V.frameOf (MT?.hs mtv)) (V.frameOf (MT?.rhs mtv)) /\ HH.disjoint (V.frameOf (MT?.hs mtv)) (B.frameOf (MT?.mroot mtv)) /\ HH.disjoint (V.frameOf (MT?.rhs mtv)) (B.frameOf (MT?.mroot mtv))) // Since a Merkle tree satisfies regionality, it's ok to take all regions from // a tree pointer as a location of the tree. val mt_loc: mt_p -> GTot loc let mt_loc mt = B.loc_all_regions_from false (B.frameOf mt) val mt_safe_preserved: mt:mt_p -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (mt_safe h0 mt /\ loc_disjoint p (mt_loc mt) /\ modifies p h0 h1)) (ensures (B.get h0 mt 0 == B.get h1 mt 0 /\ mt_safe h1 mt)) let mt_safe_preserved mt p h0 h1 = assert (loc_includes (mt_loc mt) (B.loc_buffer mt)); let mtv = B.get h0 mt 0 in assert (loc_includes (mt_loc mt) (RV.loc_rvector (MT?.hs mtv))); assert (loc_includes (mt_loc mt) (RV.loc_rvector (MT?.rhs mtv))); assert (loc_includes (mt_loc mt) (V.loc_vector (MT?.hs mtv))); assert (loc_includes (mt_loc mt) (B.loc_all_regions_from false (B.frameOf (MT?.mroot mtv)))); RV.rv_inv_preserved (MT?.hs mtv) p h0 h1; RV.rv_inv_preserved (MT?.rhs mtv) p h0 h1; Rgl?.r_sep (hreg (MT?.hash_size mtv)) (MT?.mroot mtv) p h0 h1; V.loc_vector_within_included (MT?.hs mtv) 0ul (V.size_of (MT?.hs mtv)); mt_safe_elts_preserved 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv) p h0 h1 /// Lifting to a high-level Merkle tree structure val mt_safe_elts_spec: #hsz:hash_size_t -> h:HS.mem -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j >= i} -> Lemma (requires (RV.rv_inv h hs /\ mt_safe_elts #hsz h lv hs i j)) (ensures (MTH.hs_wf_elts #(U32.v hsz) (U32.v lv) (RV.as_seq h hs) (U32.v i) (U32.v j))) (decreases (32 - U32.v lv)) #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let rec mt_safe_elts_spec #_ h lv hs i j = if lv = merkle_tree_size_lg then () else mt_safe_elts_spec h (lv + 1ul) hs (i / 2ul) (j / 2ul) #pop-options val merkle_tree_lift: h:HS.mem -> mtv:merkle_tree{ RV.rv_inv h (MT?.hs mtv) /\ RV.rv_inv h (MT?.rhs mtv) /\ Rgl?.r_inv (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv) /\ mt_safe_elts #(MT?.hash_size mtv) h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv)} -> GTot (r:MTH.merkle_tree #(U32.v (MT?.hash_size mtv)) {MTH.mt_wf_elts #_ r}) let merkle_tree_lift h mtv = mt_safe_elts_spec h 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv); MTH.MT #(U32.v (MT?.hash_size mtv)) (U32.v (MT?.i mtv)) (U32.v (MT?.j mtv)) (RV.as_seq h (MT?.hs mtv)) (MT?.rhs_ok mtv) (RV.as_seq h (MT?.rhs mtv)) (Rgl?.r_repr (hreg (MT?.hash_size mtv)) h (MT?.mroot mtv)) (Ghost.reveal (MT?.hash_spec mtv)) val mt_lift: h:HS.mem -> mt:mt_p{mt_safe h mt} -> GTot (r:MTH.merkle_tree #(U32.v (MT?.hash_size (B.get h mt 0))) {MTH.mt_wf_elts #_ r}) let mt_lift h mt = merkle_tree_lift h (B.get h mt 0) val mt_preserved: mt:mt_p -> p:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (mt_safe h0 mt /\ loc_disjoint p (mt_loc mt) /\ modifies p h0 h1)) (ensures (mt_safe_preserved mt p h0 h1; mt_lift h0 mt == mt_lift h1 mt)) let mt_preserved mt p h0 h1 = assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (B.loc_buffer mt)); B.modifies_buffer_elim mt p h0 h1; assert (B.get h0 mt 0 == B.get h1 mt 0); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (RV.loc_rvector (MT?.hs (B.get h0 mt 0)))); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (RV.loc_rvector (MT?.rhs (B.get h0 mt 0)))); assert (loc_includes (B.loc_all_regions_from false (B.frameOf mt)) (B.loc_buffer (MT?.mroot (B.get h0 mt 0)))); RV.as_seq_preserved (MT?.hs (B.get h0 mt 0)) p h0 h1; RV.as_seq_preserved (MT?.rhs (B.get h0 mt 0)) p h0 h1; B.modifies_buffer_elim (MT?.mroot (B.get h0 mt 0)) p h0 h1 /// Construction // Note that the public function for creation is `mt_create` defined below, // which builds a tree with an initial hash. #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" private val create_empty_mt: hash_size:hash_size_t -> hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hash_size)) -> hash_fun:hash_fun_t #hash_size #hash_spec -> r:HST.erid -> HST.ST mt_p (requires (fun _ -> true)) (ensures (fun h0 mt h1 -> let dmt = B.get h1 mt 0 in // memory safety B.frameOf mt = r /\ modifies (mt_loc mt) h0 h1 /\ mt_safe h1 mt /\ mt_not_full h1 mt /\ // correctness MT?.hash_size dmt = hash_size /\ MT?.offset dmt = 0UL /\ merkle_tree_lift h1 dmt == MTH.create_empty_mt #_ #(Ghost.reveal hash_spec) ())) let create_empty_mt hsz hash_spec hash_fun r = [@inline_let] let hrg = hreg hsz in [@inline_let] let hvrg = hvreg hsz in [@inline_let] let hvvrg = hvvreg hsz in let hs_region = HST.new_region r in let hs = RV.alloc_rid hvrg merkle_tree_size_lg hs_region in let h0 = HST.get () in mt_safe_elts_init #hsz h0 0ul hs; let rhs_region = HST.new_region r in let rhs = RV.alloc_rid hrg merkle_tree_size_lg rhs_region in let h1 = HST.get () in assert (RV.as_seq h1 rhs == S.create 32 (MTH.hash_init #(U32.v hsz))); RV.rv_inv_preserved hs (V.loc_vector rhs) h0 h1; RV.as_seq_preserved hs (V.loc_vector rhs) h0 h1; V.loc_vector_within_included hs 0ul (V.size_of hs); mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul (V.loc_vector rhs) h0 h1; let mroot_region = HST.new_region r in let mroot = rg_alloc hrg mroot_region in let h2 = HST.get () in RV.as_seq_preserved hs loc_none h1 h2; RV.as_seq_preserved rhs loc_none h1 h2; mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul loc_none h1 h2; let mt = B.malloc r (MT hsz 0UL 0ul 0ul hs false rhs mroot hash_spec hash_fun) 1ul in let h3 = HST.get () in RV.as_seq_preserved hs loc_none h2 h3; RV.as_seq_preserved rhs loc_none h2 h3; Rgl?.r_sep hrg mroot loc_none h2 h3; mt_safe_elts_preserved #hsz 0ul hs 0ul 0ul loc_none h2 h3; mt #pop-options /// Destruction (free) val mt_free: mt:mt_p -> HST.ST unit (requires (fun h0 -> mt_safe h0 mt)) (ensures (fun h0 _ h1 -> modifies (mt_loc mt) h0 h1)) #push-options "--z3rlimit 100" let mt_free mt = let mtv = !*mt in RV.free (MT?.hs mtv); RV.free (MT?.rhs mtv); [@inline_let] let rg = hreg (MT?.hash_size mtv) in rg_free rg (MT?.mroot mtv); B.free mt #pop-options /// Insertion private val as_seq_sub_upd: #a:Type0 -> #rst:Type -> #rg:regional rst a -> h:HS.mem -> rv:rvector #a #rst rg -> i:uint32_t{i < V.size_of rv} -> v:Rgl?.repr rg -> Lemma (requires (RV.rv_inv h rv)) (ensures (S.equal (S.upd (RV.as_seq h rv) (U32.v i) v) (S.append (RV.as_seq_sub h rv 0ul i) (S.cons v (RV.as_seq_sub h rv (i + 1ul) (V.size_of rv)))))) #push-options "--z3rlimit 20" let as_seq_sub_upd #a #rst #rg h rv i v = Seq.Properties.slice_upd (RV.as_seq h rv) 0 (U32.v i) (U32.v i) v; Seq.Properties.slice_upd (RV.as_seq h rv) (U32.v i + 1) (U32.v (V.size_of rv)) (U32.v i) v; RV.as_seq_seq_slice rg h (V.as_seq h rv) 0 (U32.v (V.size_of rv)) 0 (U32.v i); assert (S.equal (S.slice (RV.as_seq h rv) 0 (U32.v i)) (RV.as_seq_sub h rv 0ul i)); RV.as_seq_seq_slice rg h (V.as_seq h rv) 0 (U32.v (V.size_of rv)) (U32.v i + 1) (U32.v (V.size_of rv)); assert (S.equal (S.slice (RV.as_seq h rv) (U32.v i + 1) (U32.v (V.size_of rv))) (RV.as_seq_sub h rv (i + 1ul) (V.size_of rv))); assert (S.index (S.upd (RV.as_seq h rv) (U32.v i) v) (U32.v i) == v) #pop-options // `hash_vv_insert_copy` inserts a hash element at a level `lv`, by copying // and pushing its content to `hs[lv]`. For detailed insertion procedure, see // `insert_` and `mt_insert`. #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1" private inline_for_extraction val hash_vv_insert_copy: #hsz:hash_size_t -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> v:hash #hsz -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 v /\ HH.disjoint (V.frameOf hs) (B.frameOf v) /\ mt_safe_elts #hsz h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 v /\ V.size_of (V.get h1 hs lv) == j + 1ul - offset_of (Ghost.reveal i) /\ V.size_of (V.get h1 hs lv) == V.size_of (V.get h0 hs lv) + 1ul /\ mt_safe_elts #hsz h1 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) /\ RV.rv_loc_elems h0 hs (lv + 1ul) (V.size_of hs) == RV.rv_loc_elems h1 hs (lv + 1ul) (V.size_of hs) /\ // correctness (mt_safe_elts_spec #hsz h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.hashess_insert (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 v))) /\ S.equal (S.index (RV.as_seq h1 hs) (U32.v lv)) (S.snoc (S.index (RV.as_seq h0 hs) (U32.v lv)) (Rgl?.r_repr (hreg hsz) h0 v)))) let hash_vv_insert_copy #hsz lv i j hs v = let hh0 = HST.get () in mt_safe_elts_rec hh0 lv hs (Ghost.reveal i) j; /// 1) Insert an element at the level `lv`, where the new vector is not yet /// connected to `hs`. let ihv = RV.insert_copy (hcpy hsz) (V.index hs lv) v in let hh1 = HST.get () in // 1-0) Basic disjointness conditions V.forall2_forall_left hh0 hs 0ul (V.size_of hs) lv (fun b1 b2 -> HH.disjoint (Rgl?.region_of (hvreg hsz) b1) (Rgl?.region_of (hvreg hsz) b2)); V.forall2_forall_right hh0 hs 0ul (V.size_of hs) lv (fun b1 b2 -> HH.disjoint (Rgl?.region_of (hvreg hsz) b1) (Rgl?.region_of (hvreg hsz) b2)); V.loc_vector_within_included hs lv (lv + 1ul); V.loc_vector_within_included hs (lv + 1ul) (V.size_of hs); V.loc_vector_within_disjoint hs lv (lv + 1ul) (lv + 1ul) (V.size_of hs); // 1-1) For the `modifies` postcondition. assert (modifies (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) hh0 hh1); // 1-2) Preservation Rgl?.r_sep (hreg hsz) v (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; // 1-3) For `mt_safe_elts` assert (V.size_of ihv == j + 1ul - offset_of (Ghost.reveal i)); // head updated mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; // tail not yet // 1-4) For the `rv_inv` postcondition RV.rs_loc_elems_elem_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v (V.size_of hs)) 0 (U32.v lv) (U32.v lv); RV.rs_loc_elems_parent_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v lv); RV.rv_elems_inv_preserved hs 0ul lv (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; assert (RV.rv_elems_inv hh1 hs 0ul lv); RV.rs_loc_elems_elem_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) 0 (U32.v (V.size_of hs)) (U32.v lv + 1) (U32.v (V.size_of hs)) (U32.v lv); RV.rs_loc_elems_parent_disj (hvreg hsz) (V.as_seq hh0 hs) (V.frameOf hs) (U32.v lv + 1) (U32.v (V.size_of hs)); RV.rv_elems_inv_preserved hs (lv + 1ul) (V.size_of hs) (RV.loc_rvector (V.get hh0 hs lv)) hh0 hh1; assert (RV.rv_elems_inv hh1 hs (lv + 1ul) (V.size_of hs)); // assert (rv_itself_inv hh1 hs); // assert (elems_reg hh1 hs); // 1-5) Correctness assert (S.equal (RV.as_seq hh1 ihv) (S.snoc (RV.as_seq hh0 (V.get hh0 hs lv)) (Rgl?.r_repr (hreg hsz) hh0 v))); /// 2) Assign the updated vector to `hs` at the level `lv`. RV.assign hs lv ihv; let hh2 = HST.get () in // 2-1) For the `modifies` postcondition. assert (modifies (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2); assert (modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) hh0 hh2); // 2-2) Preservation Rgl?.r_sep (hreg hsz) v (RV.loc_rvector hs) hh1 hh2; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2; // 2-3) For `mt_safe_elts` assert (V.size_of (V.get hh2 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (V.loc_vector_within hs lv (lv + 1ul)) hh1 hh2; // 2-4) Correctness RV.as_seq_sub_preserved hs 0ul lv (loc_rvector ihv) hh0 hh1; RV.as_seq_sub_preserved hs (lv + 1ul) merkle_tree_size_lg (loc_rvector ihv) hh0 hh1; assert (S.equal (RV.as_seq hh2 hs) (S.append (RV.as_seq_sub hh0 hs 0ul lv) (S.cons (RV.as_seq hh1 ihv) (RV.as_seq_sub hh0 hs (lv + 1ul) merkle_tree_size_lg)))); as_seq_sub_upd hh0 hs lv (RV.as_seq hh1 ihv) #pop-options private val insert_index_helper_even: lv:uint32_t{lv < merkle_tree_size_lg} -> j:index_t{U32.v j < pow2 (32 - U32.v lv) - 1} -> Lemma (requires (j % 2ul <> 1ul)) (ensures (U32.v j % 2 <> 1 /\ j / 2ul == (j + 1ul) / 2ul)) let insert_index_helper_even lv j = () #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" private val insert_index_helper_odd: lv:uint32_t{lv < merkle_tree_size_lg} -> i:index_t -> j:index_t{i <= j && U32.v j < pow2 (32 - U32.v lv) - 1} -> Lemma (requires (j % 2ul = 1ul /\ j < uint32_32_max)) (ensures (U32.v j % 2 = 1 /\ U32.v (j / 2ul) < pow2 (32 - U32.v (lv + 1ul)) - 1 /\ (j + 1ul) / 2ul == j / 2ul + 1ul /\ j - offset_of i > 0ul)) let insert_index_helper_odd lv i j = () #pop-options private val loc_union_assoc_4: a:loc -> b:loc -> c:loc -> d:loc -> Lemma (loc_union (loc_union a b) (loc_union c d) == loc_union (loc_union a c) (loc_union b d)) let loc_union_assoc_4 a b c d = loc_union_assoc (loc_union a b) c d; loc_union_assoc a b c; loc_union_assoc a c b; loc_union_assoc (loc_union a c) b d private val insert_modifies_rec_helper: #hsz:hash_size_t -> lv:uint32_t{lv < merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> aloc:loc -> h:HS.mem -> Lemma (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) aloc) (loc_union (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc) == loc_union (loc_union (RV.rv_loc_elems h hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) aloc) #push-options "--z3rlimit 100 --initial_fuel 2 --max_fuel 2" let insert_modifies_rec_helper #hsz lv hs aloc h = assert (V.loc_vector_within hs lv (V.size_of hs) == loc_union (V.loc_vector_within hs lv (lv + 1ul)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))); RV.rs_loc_elems_rec_inverse (hvreg hsz) (V.as_seq h hs) (U32.v lv) (U32.v (V.size_of hs)); assert (RV.rv_loc_elems h hs lv (V.size_of hs) == loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs))); // Applying some association rules... loc_union_assoc (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) aloc (loc_union (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc); loc_union_assoc (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc aloc; loc_union_assoc (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (loc_union (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) aloc; loc_union_assoc_4 (RV.rs_loc_elem (hvreg hsz) (V.as_seq h hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul)) (RV.rv_loc_elems h hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs)) #pop-options private val insert_modifies_union_loc_weakening: l1:loc -> l2:loc -> l3:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (modifies l1 h0 h1)) (ensures (modifies (loc_union (loc_union l1 l2) l3) h0 h1)) let insert_modifies_union_loc_weakening l1 l2 l3 h0 h1 = B.loc_includes_union_l l1 l2 l1; B.loc_includes_union_l (loc_union l1 l2) l3 (loc_union l1 l2) private val insert_snoc_last_helper: #a:Type -> s:S.seq a{S.length s > 0} -> v:a -> Lemma (S.index (S.snoc s v) (S.length s - 1) == S.last s) let insert_snoc_last_helper #a s v = () private val rv_inv_rv_elems_reg: #a:Type0 -> #rst:Type -> #rg:regional rst a -> h:HS.mem -> rv:rvector rg -> i:uint32_t -> j:uint32_t{i <= j && j <= V.size_of rv} -> Lemma (requires (RV.rv_inv h rv)) (ensures (RV.rv_elems_reg h rv i j)) let rv_inv_rv_elems_reg #a #rst #rg h rv i j = () // `insert_` recursively inserts proper hashes to each level `lv` by // accumulating a compressed hash. For example, if there are three leaf elements // in the tree, `insert_` will change `hs` as follow: // (`hij` is a compressed hash from `hi` to `hj`) // // BEFORE INSERTION AFTER INSERTION // lv // 0 h0 h1 h2 ====> h0 h1 h2 h3 // 1 h01 h01 h23 // 2 h03 // private val insert_: #hsz:hash_size_t -> #hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> lv:uint32_t{lv < merkle_tree_size_lg} -> i:Ghost.erased index_t -> j:index_t{ Ghost.reveal i <= j && U32.v j < pow2 (32 - U32.v lv) - 1 && j < uint32_32_max} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> acc:hash #hsz -> hash_fun:hash_fun_t #hsz #hash_spec -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ Rgl?.r_inv (hreg hsz) h0 acc /\ HH.disjoint (V.frameOf hs) (B.frameOf acc) /\ mt_safe_elts h0 lv hs (Ghost.reveal i) j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (loc_union (RV.rv_loc_elems h0 hs lv (V.size_of hs)) (V.loc_vector_within hs lv (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) h0 h1 /\ RV.rv_inv h1 hs /\ Rgl?.r_inv (hreg hsz) h1 acc /\ mt_safe_elts h1 lv hs (Ghost.reveal i) (j + 1ul) /\ // correctness (mt_safe_elts_spec h0 lv hs (Ghost.reveal i) j; S.equal (RV.as_seq h1 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq h0 hs) (Rgl?.r_repr (hreg hsz) h0 acc))))) (decreases (U32.v j)) #push-options "--z3rlimit 800 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" let rec insert_ #hsz #hash_spec lv i j hs acc hash_fun = let hh0 = HST.get () in hash_vv_insert_copy lv i j hs acc; let hh1 = HST.get () in // Base conditions V.loc_vector_within_included hs lv (lv + 1ul); V.loc_vector_within_included hs (lv + 1ul) (V.size_of hs); V.loc_vector_within_disjoint hs lv (lv + 1ul) (lv + 1ul) (V.size_of hs); assert (V.size_of (V.get hh1 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul)); if j % 2ul = 1ul then (insert_index_helper_odd lv (Ghost.reveal i) j; assert (S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) > 0); let lvhs = V.index hs lv in assert (U32.v (V.size_of lvhs) == S.length (S.index (RV.as_seq hh0 hs) (U32.v lv)) + 1); assert (V.size_of lvhs > 1ul); /// 3) Update the accumulator `acc`. hash_vec_rv_inv_r_inv hh1 (V.get hh1 hs lv) (V.size_of (V.get hh1 hs lv) - 2ul); assert (Rgl?.r_inv (hreg hsz) hh1 acc); hash_fun (V.index lvhs (V.size_of lvhs - 2ul)) acc acc; let hh2 = HST.get () in // 3-1) For the `modifies` postcondition assert (modifies (B.loc_all_regions_from false (B.frameOf acc)) hh1 hh2); assert (modifies (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh2); // 3-2) Preservation RV.rv_inv_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.as_seq_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.rv_loc_elems_preserved hs (lv + 1ul) (V.size_of hs) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; assert (RV.rv_inv hh2 hs); assert (Rgl?.r_inv (hreg hsz) hh2 acc); // 3-3) For `mt_safe_elts` V.get_preserved hs lv (B.loc_region_only false (B.frameOf acc)) hh1 hh2; // head preserved mt_safe_elts_preserved (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul) (B.loc_region_only false (B.frameOf acc)) hh1 hh2; // tail preserved // 3-4) Correctness insert_snoc_last_helper (RV.as_seq hh0 (V.get hh0 hs lv)) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (Rgl?.r_repr (hreg hsz) hh2 acc) // `nacc` in `MTH.insert_` ((Ghost.reveal hash_spec) (S.last (S.index (RV.as_seq hh0 hs) (U32.v lv))) (Rgl?.r_repr (hreg hsz) hh0 acc))); /// 4) Recursion insert_ (lv + 1ul) (Ghost.hide (Ghost.reveal i / 2ul)) (j / 2ul) hs acc hash_fun; let hh3 = HST.get () in // 4-0) Memory safety brought from the postcondition of the recursion assert (RV.rv_inv hh3 hs); assert (Rgl?.r_inv (hreg hsz) hh3 acc); assert (modifies (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3); assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh3); // 4-1) For `mt_safe_elts` rv_inv_rv_elems_reg hh2 hs (lv + 1ul) (V.size_of hs); RV.rv_loc_elems_included hh2 hs (lv + 1ul) (V.size_of hs); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))); assert (loc_disjoint (V.loc_vector_within hs lv (lv + 1ul)) (B.loc_all_regions_from false (B.frameOf acc))); V.get_preserved hs lv (loc_union (loc_union (V.loc_vector_within hs (lv + 1ul) (V.size_of hs)) (RV.rv_loc_elems hh2 hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh2 hh3; assert (V.size_of (V.get hh3 hs lv) == j + 1ul - offset_of (Ghost.reveal i)); // head preserved assert (mt_safe_elts hh3 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul + 1ul)); // tail by recursion mt_safe_elts_constr hh3 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh3 lv hs (Ghost.reveal i) (j + 1ul)); // 4-2) Correctness mt_safe_elts_spec hh2 (lv + 1ul) hs (Ghost.reveal i / 2ul) (j / 2ul); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv + 1) (U32.v (Ghost.reveal i) / 2) (U32.v j / 2) (RV.as_seq hh2 hs) (Rgl?.r_repr (hreg hsz) hh2 acc))); mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_rec #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh3 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))) else (insert_index_helper_even lv j; // memory safety assert (mt_safe_elts hh1 (lv + 1ul) hs (Ghost.reveal i / 2ul) ((j + 1ul) / 2ul)); mt_safe_elts_constr hh1 lv hs (Ghost.reveal i) (j + 1ul); assert (mt_safe_elts hh1 lv hs (Ghost.reveal i) (j + 1ul)); assert (modifies (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) hh0 hh1); insert_modifies_union_loc_weakening (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc)) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc))) hh0 hh1; // correctness mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; MTH.insert_base #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc); assert (S.equal (RV.as_seq hh1 hs) (MTH.insert_ #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc)))); /// 5) Proving the postcondition after recursion let hh4 = HST.get () in // 5-1) For the `modifies` postcondition. assert (modifies (loc_union (loc_union (loc_union (RV.rs_loc_elem (hvreg hsz) (V.as_seq hh0 hs) (U32.v lv)) (V.loc_vector_within hs lv (lv + 1ul))) (B.loc_all_regions_from false (B.frameOf acc))) (loc_union (loc_union (RV.rv_loc_elems hh0 hs (lv + 1ul) (V.size_of hs)) (V.loc_vector_within hs (lv + 1ul) (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf acc)))) hh0 hh4); insert_modifies_rec_helper lv hs (B.loc_all_regions_from false (B.frameOf acc)) hh0; // 5-2) For `mt_safe_elts` assert (mt_safe_elts hh4 lv hs (Ghost.reveal i) (j + 1ul)); // 5-3) Preservation assert (RV.rv_inv hh4 hs); assert (Rgl?.r_inv (hreg hsz) hh4 acc); // 5-4) Correctness mt_safe_elts_spec hh0 lv hs (Ghost.reveal i) j; assert (S.equal (RV.as_seq hh4 hs) (MTH.insert_ #(U32.v hsz) #hash_spec (U32.v lv) (U32.v (Ghost.reveal i)) (U32.v j) (RV.as_seq hh0 hs) (Rgl?.r_repr (hreg hsz) hh0 acc))) // QED #pop-options private inline_for_extraction val mt_insert_pre_nst: mtv:merkle_tree -> v:hash #(MT?.hash_size mtv) -> Tot bool let mt_insert_pre_nst mtv v = mt_not_full_nst mtv && add64_fits (MT?.offset mtv) ((MT?.j mtv) + 1ul) val mt_insert_pre: #hsz:Ghost.erased hash_size_t -> mt:const_mt_p -> v:hash #hsz -> HST.ST bool (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ (MT?.hash_size (B.get h0 (CB.cast mt) 0)) = Ghost.reveal hsz)) (ensures (fun _ _ _ -> True)) let mt_insert_pre #hsz mt v = let mt = !*(CB.cast mt) in assert (MT?.hash_size mt == (MT?.hash_size mt)); mt_insert_pre_nst mt v // `mt_insert` inserts a hash to a Merkle tree. Note that this operation // manipulates the content in `v`, since it uses `v` as an accumulator during // insertion. #push-options "--z3rlimit 100 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" val mt_insert: hsz:Ghost.erased hash_size_t -> mt:mt_p -> v:hash #hsz -> HST.ST unit (requires (fun h0 -> let dmt = B.get h0 mt 0 in mt_safe h0 mt /\ Rgl?.r_inv (hreg hsz) h0 v /\ HH.disjoint (B.frameOf mt) (B.frameOf v) /\ MT?.hash_size dmt = Ghost.reveal hsz /\ mt_insert_pre_nst dmt v)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (mt_loc mt) (B.loc_all_regions_from false (B.frameOf v))) h0 h1 /\ mt_safe h1 mt /\ // correctness MT?.hash_size (B.get h1 mt 0) = Ghost.reveal hsz /\ mt_lift h1 mt == MTH.mt_insert (mt_lift h0 mt) (Rgl?.r_repr (hreg hsz) h0 v))) #pop-options #push-options "--z3rlimit 40" let mt_insert hsz mt v = let hh0 = HST.get () in let mtv = !*mt in let hs = MT?.hs mtv in let hsz = MT?.hash_size mtv in insert_ #hsz #(Ghost.reveal (MT?.hash_spec mtv)) 0ul (Ghost.hide (MT?.i mtv)) (MT?.j mtv) hs v (MT?.hash_fun mtv); let hh1 = HST.get () in RV.rv_loc_elems_included hh0 (MT?.hs mtv) 0ul (V.size_of hs); V.loc_vector_within_included hs 0ul (V.size_of hs); RV.rv_inv_preserved (MT?.rhs mtv) (loc_union (loc_union (RV.rv_loc_elems hh0 hs 0ul (V.size_of hs)) (V.loc_vector_within hs 0ul (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf v))) hh0 hh1; RV.as_seq_preserved (MT?.rhs mtv) (loc_union (loc_union (RV.rv_loc_elems hh0 hs 0ul (V.size_of hs)) (V.loc_vector_within hs 0ul (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf v))) hh0 hh1; Rgl?.r_sep (hreg hsz) (MT?.mroot mtv) (loc_union (loc_union (RV.rv_loc_elems hh0 hs 0ul (V.size_of hs)) (V.loc_vector_within hs 0ul (V.size_of hs))) (B.loc_all_regions_from false (B.frameOf v))) hh0 hh1; mt *= MT (MT?.hash_size mtv) (MT?.offset mtv) (MT?.i mtv) (MT?.j mtv + 1ul) (MT?.hs mtv) false // `rhs` is always deprecated right after an insertion. (MT?.rhs mtv) (MT?.mroot mtv) (MT?.hash_spec mtv) (MT?.hash_fun mtv); let hh2 = HST.get () in RV.rv_inv_preserved (MT?.hs mtv) (B.loc_buffer mt) hh1 hh2; RV.rv_inv_preserved (MT?.rhs mtv) (B.loc_buffer mt) hh1 hh2; RV.as_seq_preserved (MT?.hs mtv) (B.loc_buffer mt) hh1 hh2; RV.as_seq_preserved (MT?.rhs mtv) (B.loc_buffer mt) hh1 hh2; Rgl?.r_sep (hreg hsz) (MT?.mroot mtv) (B.loc_buffer mt) hh1 hh2; mt_safe_elts_preserved 0ul (MT?.hs mtv) (MT?.i mtv) (MT?.j mtv + 1ul) (B.loc_buffer mt) hh1 hh2 #pop-options // `mt_create` initiates a Merkle tree with a given initial hash `init`. // A valid Merkle tree should contain at least one element. val mt_create_custom: hsz:hash_size_t -> hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> r:HST.erid -> init:hash #hsz -> hash_fun:hash_fun_t #hsz #hash_spec -> HST.ST mt_p (requires (fun h0 -> Rgl?.r_inv (hreg hsz) h0 init /\ HH.disjoint r (B.frameOf init))) (ensures (fun h0 mt h1 -> // memory safety modifies (loc_union (mt_loc mt) (B.loc_all_regions_from false (B.frameOf init))) h0 h1 /\ mt_safe h1 mt /\ // correctness MT?.hash_size (B.get h1 mt 0) = hsz /\ mt_lift h1 mt == MTH.mt_create (U32.v hsz) (Ghost.reveal hash_spec) (Rgl?.r_repr (hreg hsz) h0 init))) #push-options "--z3rlimit 40" let mt_create_custom hsz hash_spec r init hash_fun = let hh0 = HST.get () in let mt = create_empty_mt hsz hash_spec hash_fun r in mt_insert hsz mt init; let hh2 = HST.get () in mt #pop-options /// Construction and Destruction of paths // Since each element pointer in `path` is from the target Merkle tree and // each element has different location in `MT?.hs` (thus different region id), // we cannot use the regionality property for `path`s. Hence here we manually // define invariants and representation. noeq type path = | Path: hash_size:hash_size_t -> hashes:V.vector (hash #hash_size) -> path type path_p = B.pointer path type const_path_p = const_pointer path private let phashes (h:HS.mem) (p:path_p) : GTot (V.vector (hash #(Path?.hash_size (B.get h p 0)))) = Path?.hashes (B.get h p 0) // Memory safety of a path as an invariant inline_for_extraction noextract val path_safe: h:HS.mem -> mtr:HH.rid -> p:path_p -> GTot Type0 let path_safe h mtr p = B.live h p /\ B.freeable p /\ V.live h (phashes h p) /\ V.freeable (phashes h p) /\ HST.is_eternal_region (V.frameOf (phashes h p)) /\ (let hsz = Path?.hash_size (B.get h p 0) in V.forall_all h (phashes h p) (fun hp -> Rgl?.r_inv (hreg hsz) h hp /\ HH.includes mtr (Rgl?.region_of (hreg hsz) hp)) /\ HH.extends (V.frameOf (phashes h p)) (B.frameOf p) /\ HH.disjoint mtr (B.frameOf p)) val path_loc: path_p -> GTot loc let path_loc p = B.loc_all_regions_from false (B.frameOf p) val lift_path_: #hsz:hash_size_t -> h:HS.mem -> hs:S.seq (hash #hsz) -> i:nat -> j:nat{ i <= j /\ j <= S.length hs /\ V.forall_seq hs i j (fun hp -> Rgl?.r_inv (hreg hsz) h hp)} -> GTot (hp:MTH.path #(U32.v hsz) {S.length hp = j - i}) (decreases j) let rec lift_path_ #hsz h hs i j = if i = j then S.empty else (S.snoc (lift_path_ h hs i (j - 1)) (Rgl?.r_repr (hreg hsz) h (S.index hs (j - 1)))) // Representation of a path val lift_path: #hsz:hash_size_t -> h:HS.mem -> mtr:HH.rid -> p:path_p {path_safe h mtr p /\ (Path?.hash_size (B.get h p 0)) = hsz} -> GTot (hp:MTH.path #(U32.v hsz) {S.length hp = U32.v (V.size_of (phashes h p))}) let lift_path #hsz h mtr p = lift_path_ h (V.as_seq h (phashes h p)) 0 (S.length (V.as_seq h (phashes h p))) val lift_path_index_: #hsz:hash_size_t -> h:HS.mem -> hs:S.seq (hash #hsz) -> i:nat -> j:nat{i <= j && j <= S.length hs} -> k:nat{i <= k && k < j} -> Lemma (requires (V.forall_seq hs i j (fun hp -> Rgl?.r_inv (hreg hsz) h hp))) (ensures (Rgl?.r_repr (hreg hsz) h (S.index hs k) == S.index (lift_path_ h hs i j) (k - i))) (decreases j) [SMTPat (S.index (lift_path_ h hs i j) (k - i))] #push-options "--initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" let rec lift_path_index_ #hsz h hs i j k = if i = j then () else if k = j - 1 then () else lift_path_index_ #hsz h hs i (j - 1) k #pop-options val lift_path_index: h:HS.mem -> mtr:HH.rid -> p:path_p -> i:uint32_t -> Lemma (requires (path_safe h mtr p /\ i < V.size_of (phashes h p))) (ensures (let hsz = Path?.hash_size (B.get h p 0) in Rgl?.r_repr (hreg hsz) h (V.get h (phashes h p) i) == S.index (lift_path #(hsz) h mtr p) (U32.v i))) let lift_path_index h mtr p i = lift_path_index_ h (V.as_seq h (phashes h p)) 0 (S.length (V.as_seq h (phashes h p))) (U32.v i) val lift_path_eq: #hsz:hash_size_t -> h:HS.mem -> hs1:S.seq (hash #hsz) -> hs2:S.seq (hash #hsz) -> i:nat -> j:nat -> Lemma (requires (i <= j /\ j <= S.length hs1 /\ j <= S.length hs2 /\ S.equal (S.slice hs1 i j) (S.slice hs2 i j) /\ V.forall_seq hs1 i j (fun hp -> Rgl?.r_inv (hreg hsz) h hp) /\ V.forall_seq hs2 i j (fun hp -> Rgl?.r_inv (hreg hsz) h hp))) (ensures (S.equal (lift_path_ h hs1 i j) (lift_path_ h hs2 i j))) let lift_path_eq #hsz h hs1 hs2 i j = assert (forall (k:nat{i <= k && k < j}). S.index (lift_path_ h hs1 i j) (k - i) == Rgl?.r_repr (hreg hsz) h (S.index hs1 k)); assert (forall (k:nat{i <= k && k < j}). S.index (lift_path_ h hs2 i j) (k - i) == Rgl?.r_repr (hreg hsz) h (S.index hs2 k)); assert (forall (k:nat{k < j - i}). S.index (lift_path_ h hs1 i j) k == Rgl?.r_repr (hreg hsz) h (S.index hs1 (k + i))); assert (forall (k:nat{k < j - i}). S.index (lift_path_ h hs2 i j) k == Rgl?.r_repr (hreg hsz) h (S.index hs2 (k + i))); assert (forall (k:nat{k < j - i}). S.index (S.slice hs1 i j) k == S.index (S.slice hs2 i j) k); assert (forall (k:nat{i <= k && k < j}). S.index (S.slice hs1 i j) (k - i) == S.index (S.slice hs2 i j) (k - i)) private val path_safe_preserved_: #hsz:hash_size_t -> mtr:HH.rid -> hs:S.seq (hash #hsz) -> i:nat -> j:nat{i <= j && j <= S.length hs} -> dl:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (V.forall_seq hs i j (fun hp -> Rgl?.r_inv (hreg hsz) h0 hp /\ HH.includes mtr (Rgl?.region_of (hreg hsz) hp)) /\ loc_disjoint dl (B.loc_all_regions_from false mtr) /\ modifies dl h0 h1)) (ensures (V.forall_seq hs i j (fun hp -> Rgl?.r_inv (hreg hsz) h1 hp /\ HH.includes mtr (Rgl?.region_of (hreg hsz) hp)))) (decreases j) let rec path_safe_preserved_ #hsz mtr hs i j dl h0 h1 = if i = j then () else (assert (loc_includes (B.loc_all_regions_from false mtr) (B.loc_all_regions_from false (Rgl?.region_of (hreg hsz) (S.index hs (j - 1))))); Rgl?.r_sep (hreg hsz) (S.index hs (j - 1)) dl h0 h1; path_safe_preserved_ mtr hs i (j - 1) dl h0 h1) val path_safe_preserved: mtr:HH.rid -> p:path_p -> dl:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (path_safe h0 mtr p /\ loc_disjoint dl (path_loc p) /\ loc_disjoint dl (B.loc_all_regions_from false mtr) /\ modifies dl h0 h1)) (ensures (path_safe h1 mtr p)) let path_safe_preserved mtr p dl h0 h1 = assert (loc_includes (path_loc p) (B.loc_buffer p)); assert (loc_includes (path_loc p) (V.loc_vector (phashes h0 p))); path_safe_preserved_ mtr (V.as_seq h0 (phashes h0 p)) 0 (S.length (V.as_seq h0 (phashes h0 p))) dl h0 h1 val path_safe_init_preserved: mtr:HH.rid -> p:path_p -> dl:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (path_safe h0 mtr p /\ V.size_of (phashes h0 p) = 0ul /\ B.loc_disjoint dl (path_loc p) /\ modifies dl h0 h1)) (ensures (path_safe h1 mtr p /\ V.size_of (phashes h1 p) = 0ul)) let path_safe_init_preserved mtr p dl h0 h1 = assert (loc_includes (path_loc p) (B.loc_buffer p)); assert (loc_includes (path_loc p) (V.loc_vector (phashes h0 p))) val path_preserved_: #hsz:hash_size_t -> mtr:HH.rid -> hs:S.seq (hash #hsz) -> i:nat -> j:nat{i <= j && j <= S.length hs} -> dl:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (V.forall_seq hs i j (fun hp -> Rgl?.r_inv (hreg hsz) h0 hp /\ HH.includes mtr (Rgl?.region_of (hreg hsz) hp)) /\ loc_disjoint dl (B.loc_all_regions_from false mtr) /\ modifies dl h0 h1)) (ensures (path_safe_preserved_ mtr hs i j dl h0 h1; S.equal (lift_path_ h0 hs i j) (lift_path_ h1 hs i j))) (decreases j) #push-options "--initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" let rec path_preserved_ #hsz mtr hs i j dl h0 h1 = if i = j then () else (path_safe_preserved_ mtr hs i (j - 1) dl h0 h1; path_preserved_ mtr hs i (j - 1) dl h0 h1; assert (loc_includes (B.loc_all_regions_from false mtr) (B.loc_all_regions_from false (Rgl?.region_of (hreg hsz) (S.index hs (j - 1))))); Rgl?.r_sep (hreg hsz) (S.index hs (j - 1)) dl h0 h1) #pop-options val path_preserved: mtr:HH.rid -> p:path_p -> dl:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (path_safe h0 mtr p /\ loc_disjoint dl (path_loc p) /\ loc_disjoint dl (B.loc_all_regions_from false mtr) /\ modifies dl h0 h1)) (ensures (path_safe_preserved mtr p dl h0 h1; let hsz0 = (Path?.hash_size (B.get h0 p 0)) in let hsz1 = (Path?.hash_size (B.get h1 p 0)) in let b:MTH.path = lift_path #hsz0 h0 mtr p in let a:MTH.path = lift_path #hsz1 h1 mtr p in hsz0 = hsz1 /\ S.equal b a)) let path_preserved mtr p dl h0 h1 = assert (loc_includes (path_loc p) (B.loc_buffer p)); assert (loc_includes (path_loc p) (V.loc_vector (phashes h0 p))); path_preserved_ mtr (V.as_seq h0 (phashes h0 p)) 0 (S.length (V.as_seq h0 (phashes h0 p))) dl h0 h1 val init_path: hsz:hash_size_t -> mtr:HH.rid -> r:HST.erid -> HST.ST path_p (requires (fun h0 -> HH.disjoint mtr r)) (ensures (fun h0 p h1 -> // memory safety path_safe h1 mtr p /\ // correctness Path?.hash_size (B.get h1 p 0) = hsz /\ S.equal (lift_path #hsz h1 mtr p) S.empty)) let init_path hsz mtr r = let nrid = HST.new_region r in (B.malloc r (Path hsz (rg_alloc (hvreg hsz) nrid)) 1ul) val clear_path: mtr:HH.rid -> p:path_p -> HST.ST unit (requires (fun h0 -> path_safe h0 mtr p)) (ensures (fun h0 _ h1 -> // memory safety path_safe h1 mtr p /\ // correctness V.size_of (phashes h1 p) = 0ul /\ S.equal (lift_path #(Path?.hash_size (B.get h1 p 0)) h1 mtr p) S.empty)) let clear_path mtr p = let pv = !*p in p *= Path (Path?.hash_size pv) (V.clear (Path?.hashes pv)) val free_path: p:path_p -> HST.ST unit (requires (fun h0 -> B.live h0 p /\ B.freeable p /\ V.live h0 (phashes h0 p) /\ V.freeable (phashes h0 p) /\ HH.extends (V.frameOf (phashes h0 p)) (B.frameOf p))) (ensures (fun h0 _ h1 -> modifies (path_loc p) h0 h1)) let free_path p = let pv = !*p in V.free (Path?.hashes pv); B.free p /// Getting the Merkle root and path // Construct "rightmost hashes" for a given (incomplete) Merkle tree. // This function calculates the Merkle root as well, which is the final // accumulator value. private val construct_rhs: #hsz:hash_size_t -> #hash_spec:Ghost.erased (MTS.hash_fun_t #(U32.v hsz)) -> lv:uint32_t{lv <= merkle_tree_size_lg} -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> rhs:hash_vec #hsz {V.size_of rhs = merkle_tree_size_lg} -> i:index_t -> j:index_t{i <= j && (U32.v j) < pow2 (32 - U32.v lv)} -> acc:hash #hsz -> actd:bool -> hash_fun:hash_fun_t #hsz #(Ghost.reveal hash_spec) -> HST.ST unit (requires (fun h0 -> RV.rv_inv h0 hs /\ RV.rv_inv h0 rhs /\ HH.disjoint (V.frameOf hs) (V.frameOf rhs) /\ Rgl?.r_inv (hreg hsz) h0 acc /\ HH.disjoint (B.frameOf acc) (V.frameOf hs) /\ HH.disjoint (B.frameOf acc) (V.frameOf rhs) /\ mt_safe_elts #hsz h0 lv hs i j)) (ensures (fun h0 _ h1 -> // memory safety modifies (loc_union (RV.loc_rvector rhs) (B.loc_all_regions_from false (B.frameOf acc))) h0 h1 /\ RV.rv_inv h1 rhs /\ Rgl?.r_inv (hreg hsz) h1 acc /\ // correctness (mt_safe_elts_spec #hsz h0 lv hs i j; MTH.construct_rhs #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (Rgl?.r_repr (hvvreg hsz) h0 hs) (Rgl?.r_repr (hvreg hsz) h0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) h0 acc) actd == (Rgl?.r_repr (hvreg hsz) h1 rhs, Rgl?.r_repr (hreg hsz) h1 acc) ))) (decreases (U32.v j)) #push-options "--z3rlimit 250 --initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1" let rec construct_rhs #hsz #hash_spec lv hs rhs i j acc actd hash_fun = let hh0 = HST.get () in if j = 0ul then begin assert (RV.rv_inv hh0 hs); assert (mt_safe_elts #hsz hh0 lv hs i j); mt_safe_elts_spec #hsz hh0 lv hs 0ul 0ul; assert (MTH.hs_wf_elts #(U32.v hsz) (U32.v lv) (RV.as_seq hh0 hs) (U32.v i) (U32.v j)); let hh1 = HST.get() in assert (MTH.construct_rhs #(U32.v hsz) #(Ghost.reveal hash_spec) (U32.v lv) (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 acc) actd == (Rgl?.r_repr (hvreg hsz) hh1 rhs, Rgl?.r_repr (hreg hsz) hh1 acc)) end else let ofs = offset_of i in begin (if j % 2ul = 0ul then begin Math.Lemmas.pow2_double_mult (32 - U32.v lv - 1); mt_safe_elts_rec #hsz hh0 lv hs i j; construct_rhs #hsz #hash_spec (lv + 1ul) hs rhs (i / 2ul) (j / 2ul) acc actd hash_fun; let hh1 = HST.get () in // correctness mt_safe_elts_spec #hsz hh0 lv hs i j; MTH.construct_rhs_even #(U32.v hsz) #hash_spec (U32.v lv) (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 acc) actd; assert (MTH.construct_rhs #(U32.v hsz) #hash_spec (U32.v lv) (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 acc) actd == (Rgl?.r_repr (hvreg hsz) hh1 rhs, Rgl?.r_repr (hreg hsz) hh1 acc)) end else begin if actd then begin RV.assign_copy (hcpy hsz) rhs lv acc; let hh1 = HST.get () in // memory safety Rgl?.r_sep (hreg hsz) acc (B.loc_all_regions_from false (V.frameOf rhs)) hh0 hh1; RV.rv_inv_preserved hs (B.loc_all_regions_from false (V.frameOf rhs)) hh0 hh1; RV.as_seq_preserved hs (B.loc_all_regions_from false (V.frameOf rhs)) hh0 hh1; RV.rv_inv_preserved (V.get hh0 hs lv) (B.loc_all_regions_from false (V.frameOf rhs)) hh0 hh1; V.loc_vector_within_included hs lv (V.size_of hs); mt_safe_elts_preserved lv hs i j (B.loc_all_regions_from false (V.frameOf rhs)) hh0 hh1; mt_safe_elts_head hh1 lv hs i j; hash_vv_rv_inv_r_inv hh1 hs lv (j - 1ul - ofs); // correctness assert (S.equal (RV.as_seq hh1 rhs) (S.upd (RV.as_seq hh0 rhs) (U32.v lv) (Rgl?.r_repr (hreg hsz) hh0 acc))); hash_fun (V.index (V.index hs lv) (j - 1ul - ofs)) acc acc; let hh2 = HST.get () in // memory safety mt_safe_elts_preserved lv hs i j (B.loc_all_regions_from false (B.frameOf acc)) hh1 hh2; RV.rv_inv_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.rv_inv_preserved rhs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.as_seq_preserved hs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; RV.as_seq_preserved rhs (B.loc_region_only false (B.frameOf acc)) hh1 hh2; // correctness hash_vv_as_seq_get_index hh0 hs lv (j - 1ul - ofs); assert (Rgl?.r_repr (hreg hsz) hh2 acc == (Ghost.reveal hash_spec) (S.index (S.index (RV.as_seq hh0 hs) (U32.v lv)) (U32.v j - 1 - U32.v ofs)) (Rgl?.r_repr (hreg hsz) hh0 acc)) end else begin mt_safe_elts_head hh0 lv hs i j; hash_vv_rv_inv_r_inv hh0 hs lv (j - 1ul - ofs); hash_vv_rv_inv_disjoint hh0 hs lv (j - 1ul - ofs) (B.frameOf acc); Cpy?.copy (hcpy hsz) hsz (V.index (V.index hs lv) (j - 1ul - ofs)) acc; let hh1 = HST.get () in // memory safety V.loc_vector_within_included hs lv (V.size_of hs); mt_safe_elts_preserved lv hs i j (B.loc_all_regions_from false (B.frameOf acc)) hh0 hh1; RV.rv_inv_preserved hs (B.loc_all_regions_from false (B.frameOf acc)) hh0 hh1; RV.rv_inv_preserved rhs (B.loc_all_regions_from false (B.frameOf acc)) hh0 hh1; RV.as_seq_preserved hs (B.loc_all_regions_from false (B.frameOf acc)) hh0 hh1; RV.as_seq_preserved rhs (B.loc_all_regions_from false (B.frameOf acc)) hh0 hh1; // correctness hash_vv_as_seq_get_index hh0 hs lv (j - 1ul - ofs); assert (Rgl?.r_repr (hreg hsz) hh1 acc == S.index (S.index (RV.as_seq hh0 hs) (U32.v lv)) (U32.v j - 1 - U32.v ofs)) end; let hh3 = HST.get () in assert (S.equal (RV.as_seq hh3 hs) (RV.as_seq hh0 hs)); assert (S.equal (RV.as_seq hh3 rhs) (if actd then S.upd (RV.as_seq hh0 rhs) (U32.v lv) (Rgl?.r_repr (hreg hsz) hh0 acc) else RV.as_seq hh0 rhs)); assert (Rgl?.r_repr (hreg hsz) hh3 acc == (if actd then (Ghost.reveal hash_spec) (S.index (S.index (RV.as_seq hh0 hs) (U32.v lv)) (U32.v j - 1 - U32.v ofs)) (Rgl?.r_repr (hreg hsz) hh0 acc) else S.index (S.index (RV.as_seq hh0 hs) (U32.v lv)) (U32.v j - 1 - U32.v ofs))); mt_safe_elts_rec hh3 lv hs i j; construct_rhs #hsz #hash_spec (lv + 1ul) hs rhs (i / 2ul) (j / 2ul) acc true hash_fun; let hh4 = HST.get () in mt_safe_elts_spec hh3 (lv + 1ul) hs (i / 2ul) (j / 2ul); assert (MTH.construct_rhs #(U32.v hsz) #hash_spec (U32.v lv + 1) (Rgl?.r_repr (hvvreg hsz) hh3 hs) (Rgl?.r_repr (hvreg hsz) hh3 rhs) (U32.v i / 2) (U32.v j / 2) (Rgl?.r_repr (hreg hsz) hh3 acc) true == (Rgl?.r_repr (hvreg hsz) hh4 rhs, Rgl?.r_repr (hreg hsz) hh4 acc)); mt_safe_elts_spec hh0 lv hs i j; MTH.construct_rhs_odd #(U32.v hsz) #hash_spec (U32.v lv) (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 acc) actd; assert (MTH.construct_rhs #(U32.v hsz) #hash_spec (U32.v lv) (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 acc) actd == (Rgl?.r_repr (hvreg hsz) hh4 rhs, Rgl?.r_repr (hreg hsz) hh4 acc)) end) end #pop-options private inline_for_extraction val mt_get_root_pre_nst: mtv:merkle_tree -> rt:hash #(MT?.hash_size mtv) -> Tot bool let mt_get_root_pre_nst mtv rt = true val mt_get_root_pre: #hsz:Ghost.erased hash_size_t -> mt:const_mt_p -> rt:hash #hsz -> HST.ST bool (requires (fun h0 -> let mt = CB.cast mt in MT?.hash_size (B.get h0 mt 0) = Ghost.reveal hsz /\ mt_safe h0 mt /\ Rgl?.r_inv (hreg hsz) h0 rt /\ HH.disjoint (B.frameOf mt) (B.frameOf rt))) (ensures (fun _ _ _ -> True)) let mt_get_root_pre #hsz mt rt = let mt = CB.cast mt in let mt = !*mt in let hsz = MT?.hash_size mt in assert (MT?.hash_size mt = hsz); mt_get_root_pre_nst mt rt // `mt_get_root` returns the Merkle root. If it's already calculated with // up-to-date hashes, the root is returned immediately. Otherwise it calls // `construct_rhs` to build rightmost hashes and to calculate the Merkle root // as well. val mt_get_root: #hsz:Ghost.erased hash_size_t -> mt:const_mt_p -> rt:hash #hsz -> HST.ST unit (requires (fun h0 -> let mt = CB.cast mt in let dmt = B.get h0 mt 0 in MT?.hash_size dmt = (Ghost.reveal hsz) /\ mt_get_root_pre_nst dmt rt /\ mt_safe h0 mt /\ Rgl?.r_inv (hreg hsz) h0 rt /\ HH.disjoint (B.frameOf mt) (B.frameOf rt))) (ensures (fun h0 _ h1 -> let mt = CB.cast mt in // memory safety modifies (loc_union (mt_loc mt) (B.loc_all_regions_from false (B.frameOf rt))) h0 h1 /\ mt_safe h1 mt /\ (let mtv0 = B.get h0 mt 0 in let mtv1 = B.get h1 mt 0 in MT?.hash_size mtv0 = (Ghost.reveal hsz) /\ MT?.hash_size mtv1 = (Ghost.reveal hsz) /\ MT?.i mtv1 = MT?.i mtv0 /\ MT?.j mtv1 = MT?.j mtv0 /\ MT?.hs mtv1 == MT?.hs mtv0 /\ MT?.rhs mtv1 == MT?.rhs mtv0 /\ MT?.offset mtv1 == MT?.offset mtv0 /\ MT?.rhs_ok mtv1 = true /\ Rgl?.r_inv (hreg hsz) h1 rt /\ // correctness MTH.mt_get_root (mt_lift h0 mt) (Rgl?.r_repr (hreg hsz) h0 rt) == (mt_lift h1 mt, Rgl?.r_repr (hreg hsz) h1 rt)))) #push-options "--z3rlimit 150 --initial_fuel 1 --max_fuel 1" let mt_get_root #hsz mt rt = let mt = CB.cast mt in let hh0 = HST.get () in let mtv = !*mt in let prefix = MT?.offset mtv in let i = MT?.i mtv in let j = MT?.j mtv in let hs = MT?.hs mtv in let rhs = MT?.rhs mtv in let mroot = MT?.mroot mtv in let hash_size = MT?.hash_size mtv in let hash_spec = MT?.hash_spec mtv in let hash_fun = MT?.hash_fun mtv in if MT?.rhs_ok mtv then begin Cpy?.copy (hcpy hash_size) hash_size mroot rt; let hh1 = HST.get () in mt_safe_preserved mt (B.loc_all_regions_from false (Rgl?.region_of (hreg hsz) rt)) hh0 hh1; mt_preserved mt (B.loc_all_regions_from false (Rgl?.region_of (hreg hsz) rt)) hh0 hh1; MTH.mt_get_root_rhs_ok_true (mt_lift hh0 mt) (Rgl?.r_repr (hreg hsz) hh0 rt); assert (MTH.mt_get_root (mt_lift hh0 mt) (Rgl?.r_repr (hreg hsz) hh0 rt) == (mt_lift hh1 mt, Rgl?.r_repr (hreg hsz) hh1 rt)) end else begin construct_rhs #hash_size #hash_spec 0ul hs rhs i j rt false hash_fun; let hh1 = HST.get () in // memory safety assert (RV.rv_inv hh1 rhs); assert (Rgl?.r_inv (hreg hsz) hh1 rt); assert (B.live hh1 mt); RV.rv_inv_preserved hs (loc_union (RV.loc_rvector rhs) (B.loc_all_regions_from false (B.frameOf rt))) hh0 hh1; RV.as_seq_preserved hs (loc_union (RV.loc_rvector rhs) (B.loc_all_regions_from false (B.frameOf rt))) hh0 hh1; V.loc_vector_within_included hs 0ul (V.size_of hs); mt_safe_elts_preserved 0ul hs i j (loc_union (RV.loc_rvector rhs) (B.loc_all_regions_from false (B.frameOf rt))) hh0 hh1; // correctness mt_safe_elts_spec hh0 0ul hs i j; assert (MTH.construct_rhs #(U32.v hash_size) #hash_spec 0 (Rgl?.r_repr (hvvreg hsz) hh0 hs) (Rgl?.r_repr (hvreg hsz) hh0 rhs) (U32.v i) (U32.v j) (Rgl?.r_repr (hreg hsz) hh0 rt) false == (Rgl?.r_repr (hvreg hsz) hh1 rhs, Rgl?.r_repr (hreg hsz) hh1 rt)); Cpy?.copy (hcpy hash_size) hash_size rt mroot; let hh2 = HST.get () in // memory safety RV.rv_inv_preserved hs (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; RV.rv_inv_preserved rhs (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; RV.as_seq_preserved hs (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; RV.as_seq_preserved rhs (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; B.modifies_buffer_elim rt (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; mt_safe_elts_preserved 0ul hs i j (B.loc_all_regions_from false (B.frameOf mroot)) hh1 hh2; // correctness assert (Rgl?.r_repr (hreg hsz) hh2 mroot == Rgl?.r_repr (hreg hsz) hh1 rt); mt *= MT hash_size prefix i j hs true rhs mroot hash_spec hash_fun; let hh3 = HST.get () in // memory safety Rgl?.r_sep (hreg hsz) rt (B.loc_buffer mt) hh2 hh3; RV.rv_inv_preserved hs (B.loc_buffer mt) hh2 hh3; RV.rv_inv_preserved rhs (B.loc_buffer mt) hh2 hh3; RV.as_seq_preserved hs (B.loc_buffer mt) hh2 hh3; RV.as_seq_preserved rhs (B.loc_buffer mt) hh2 hh3; Rgl?.r_sep (hreg hsz) mroot (B.loc_buffer mt) hh2 hh3; mt_safe_elts_preserved 0ul hs i j (B.loc_buffer mt) hh2 hh3; assert (mt_safe hh3 mt); // correctness MTH.mt_get_root_rhs_ok_false (mt_lift hh0 mt) (Rgl?.r_repr (hreg hsz) hh0 rt); assert (MTH.mt_get_root (mt_lift hh0 mt) (Rgl?.r_repr (hreg hsz) hh0 rt) == (MTH.MT #(U32.v hash_size) (U32.v i) (U32.v j) (RV.as_seq hh0 hs) true (RV.as_seq hh1 rhs) (Rgl?.r_repr (hreg hsz) hh1 rt) hash_spec, Rgl?.r_repr (hreg hsz) hh1 rt)); assert (MTH.mt_get_root (mt_lift hh0 mt) (Rgl?.r_repr (hreg hsz) hh0 rt) == (mt_lift hh3 mt, Rgl?.r_repr (hreg hsz) hh3 rt)) end #pop-options inline_for_extraction val mt_path_insert: #hsz:hash_size_t -> mtr:HH.rid -> p:path_p -> hp:hash #hsz -> HST.ST unit (requires (fun h0 -> path_safe h0 mtr p /\ not (V.is_full (phashes h0 p)) /\ Rgl?.r_inv (hreg hsz) h0 hp /\ HH.disjoint mtr (B.frameOf p) /\ HH.includes mtr (B.frameOf hp) /\ Path?.hash_size (B.get h0 p 0) = hsz)) (ensures (fun h0 _ h1 -> // memory safety modifies (path_loc p) h0 h1 /\ path_safe h1 mtr p /\ // correctness (let hsz0 = Path?.hash_size (B.get h0 p 0) in let hsz1 = Path?.hash_size (B.get h1 p 0) in (let before:(S.seq (MTH.hash #(U32.v hsz0))) = lift_path h0 mtr p in let after:(S.seq (MTH.hash #(U32.v hsz1))) = lift_path h1 mtr p in V.size_of (phashes h1 p) = V.size_of (phashes h0 p) + 1ul /\ hsz = hsz0 /\ hsz = hsz1 /\ (let hspec:(S.seq (MTH.hash #(U32.v hsz))) = (MTH.path_insert #(U32.v hsz) before (Rgl?.r_repr (hreg hsz) h0 hp)) in S.equal hspec after))))) #push-options "--z3rlimit 20 --initial_fuel 1 --max_fuel 1" let mt_path_insert #hsz mtr p hp = let pth = !*p in let pv = Path?.hashes pth in let hh0 = HST.get () in let ipv = V.insert pv hp in let hh1 = HST.get () in path_safe_preserved_ mtr (V.as_seq hh0 pv) 0 (S.length (V.as_seq hh0 pv)) (B.loc_all_regions_from false (V.frameOf ipv)) hh0 hh1; path_preserved_ mtr (V.as_seq hh0 pv) 0 (S.length (V.as_seq hh0 pv)) (B.loc_all_regions_from false (V.frameOf ipv)) hh0 hh1; Rgl?.r_sep (hreg hsz) hp (B.loc_all_regions_from false (V.frameOf ipv)) hh0 hh1; p *= Path hsz ipv; let hh2 = HST.get () in path_safe_preserved_ mtr (V.as_seq hh1 ipv) 0 (S.length (V.as_seq hh1 ipv)) (B.loc_region_only false (B.frameOf p)) hh1 hh2; path_preserved_ mtr (V.as_seq hh1 ipv) 0 (S.length (V.as_seq hh1 ipv)) (B.loc_region_only false (B.frameOf p)) hh1 hh2; Rgl?.r_sep (hreg hsz) hp (B.loc_region_only false (B.frameOf p)) hh1 hh2; assert (S.equal (lift_path hh2 mtr p) (lift_path_ hh1 (S.snoc (V.as_seq hh0 pv) hp) 0 (S.length (V.as_seq hh1 ipv)))); lift_path_eq hh1 (S.snoc (V.as_seq hh0 pv) hp) (V.as_seq hh0 pv) 0 (S.length (V.as_seq hh0 pv)) #pop-options // For given a target index `k`, the number of elements (in the tree) `j`, // and a boolean flag (to check the existence of rightmost hashes), we can // calculate a required Merkle path length. // // `mt_path_length` is a postcondition of `mt_get_path`, and a precondition // of `mt_verify`. For detailed description, see `mt_get_path` and `mt_verify`. private val mt_path_length_step: k:index_t -> j:index_t{k <= j} -> actd:bool -> Tot (sl:uint32_t{U32.v sl = MTH.mt_path_length_step (U32.v k) (U32.v j) actd}) let mt_path_length_step k j actd = if j = 0ul then 0ul else (if k % 2ul = 0ul then (if j = k || (j = k + 1ul && not actd) then 0ul else 1ul) else 1ul) private inline_for_extraction val mt_path_length: lv:uint32_t{lv <= merkle_tree_size_lg} -> k:index_t -> j:index_t{k <= j && U32.v j < pow2 (32 - U32.v lv)} -> actd:bool -> Tot (l:uint32_t{ U32.v l = MTH.mt_path_length (U32.v k) (U32.v j) actd && l <= 32ul - lv}) (decreases (U32.v j)) #push-options "--z3rlimit 10 --initial_fuel 1 --max_fuel 1" let rec mt_path_length lv k j actd = if j = 0ul then 0ul else (let nactd = actd || (j % 2ul = 1ul) in mt_path_length_step k j actd + mt_path_length (lv + 1ul) (k / 2ul) (j / 2ul) nactd) #pop-options val mt_get_path_length: mtr:HH.rid -> p:const_path_p -> HST.ST uint32_t (requires (fun h0 -> path_safe h0 mtr (CB.cast p))) (ensures (fun h0 _ h1 -> True)) let mt_get_path_length mtr p = let pd = !*(CB.cast p) in V.size_of (Path?.hashes pd) private inline_for_extraction val mt_make_path_step: #hsz:hash_size_t -> lv:uint32_t{lv <= merkle_tree_size_lg} -> mtr:HH.rid -> hs:hash_vv hsz {V.size_of hs = merkle_tree_size_lg} -> rhs:hash_vec #hsz {V.size_of rhs = merkle_tree_size_lg} -> i:index_t -> j:index_t{j <> 0ul /\ i <= j /\ U32.v j < pow2 (32 - U32.v lv)} -> k:index_t{i <= k && k <= j} -> p:path_p -> actd:bool -> HST.ST unit (requires (fun h0 -> HH.includes mtr (V.frameOf hs) /\ HH.includes mtr (V.frameOf rhs) /\ RV.rv_inv h0 hs /\ RV.rv_inv h0 rhs /\ mt_safe_elts h0 lv hs i j /\ path_safe h0 mtr p /\ Path?.hash_size (B.get h0 p 0) = hsz /\ V.size_of (phashes h0 p) <= lv + 1ul)) (ensures (fun h0 _ h1 -> // memory safety modifies (path_loc p) h0 h1 /\ path_safe h1 mtr p /\ V.size_of (phashes h1 p) == V.size_of (phashes h0 p) + mt_path_length_step k j actd /\ V.size_of (phashes h1 p) <= lv + 2ul /\ // correctness (mt_safe_elts_spec h0 lv hs i j; (let hsz0 = Path?.hash_size (B.get h0 p 0) in let hsz1 = Path?.hash_size (B.get h1 p 0) in let before:(S.seq (MTH.hash #(U32.v hsz0))) = lift_path h0 mtr p in let after:(S.seq (MTH.hash #(U32.v hsz1))) = lift_path h1 mtr p in hsz = hsz0 /\ hsz = hsz1 /\ S.equal after (MTH.mt_make_path_step (U32.v lv) (RV.as_seq h0 hs) (RV.as_seq h0 rhs) (U32.v i) (U32.v j) (U32.v k) before actd)))))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.New.High.fst.checked", "MerkleTree.Low.VectorExtras.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.ByteBuffer.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Seq.Properties.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperStack.fsti.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked", "FStar.All.fst.checked", "EverCrypt.Helpers.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.fst" }
[ { "abbrev": false, "full_module": "MerkleTree.Low.VectorExtras", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": true, "full_module": "MerkleTree.New.High", "short_module": "MTH" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Seq", "short_module": "S" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperStack", "short_module": "MHS" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Buffer", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "FStar.All", "short_module": null }, { "abbrev": false, "full_module": "EverCrypt.Helpers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree", "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": 1, "initial_ifuel": 2, "max_fuel": 1, "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": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
lv: LowStar.Vector.uint32_t{lv <= MerkleTree.Low.merkle_tree_size_lg} -> mtr: FStar.Monotonic.HyperHeap.rid -> hs: MerkleTree.Low.Datastructures.hash_vv hsz {LowStar.Vector.size_of hs = MerkleTree.Low.merkle_tree_size_lg} -> rhs: MerkleTree.Low.Datastructures.hash_vec {LowStar.Vector.size_of rhs = MerkleTree.Low.merkle_tree_size_lg} -> i: MerkleTree.Low.index_t -> j: MerkleTree.Low.index_t {j <> 0ul /\ i <= j /\ FStar.UInt32.v j < Prims.pow2 (32 - FStar.UInt32.v lv)} -> k: MerkleTree.Low.index_t{i <= k && k <= j} -> p: MerkleTree.Low.path_p -> actd: Prims.bool -> FStar.HyperStack.ST.ST Prims.unit
FStar.HyperStack.ST.ST
[]
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "LowStar.Vector.uint32_t", "Prims.b2t", "FStar.Integers.op_Less_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "MerkleTree.Low.merkle_tree_size_lg", "FStar.Monotonic.HyperHeap.rid", "MerkleTree.Low.Datastructures.hash_vv", "Prims.op_Equality", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.index_t", "Prims.l_and", "Prims.op_disEquality", "FStar.UInt32.t", "FStar.UInt32.__uint_to_t", "FStar.Integers.op_Less", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "FStar.UInt32.v", "Prims.pow2", "FStar.Integers.op_Subtraction", "Prims.op_AmpAmp", "MerkleTree.Low.path_p", "Prims.bool", "FStar.Integers.op_Percent", "MerkleTree.Low.mt_path_insert", "Prims.unit", "LowStar.Vector.index", "LowStar.Vector.vector", "Prims._assert", "MerkleTree.Low.__proj__Path__item__hash_size", "FStar.Monotonic.HyperHeap.includes", "LowStar.Monotonic.Buffer.frameOf", "Lib.IntTypes.uint8", "LowStar.Buffer.trivial_preorder", "LowStar.Vector.get", "MerkleTree.Low.Datastructures.hash_vv_rv_inv_includes", "Prims.l_or", "FStar.Integers.op_Plus", "MerkleTree.Low.offset_of", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "MerkleTree.Low.path", "LowStar.BufferOps.op_Bang_Star" ]
[]
false
true
false
false
false
let mt_make_path_step #hsz lv mtr hs rhs i j k p actd =
let pth = !*p in let hh0 = HST.get () in let ofs = offset_of i in if k % 2ul = 1ul then (hash_vv_rv_inv_includes hh0 hs lv (k - 1ul - ofs); assert (HH.includes mtr (B.frameOf (V.get hh0 (V.get hh0 hs lv) (k - 1ul - ofs)))); assert (Path?.hash_size pth = hsz); mt_path_insert #hsz mtr p (V.index (V.index hs lv) (k - 1ul - ofs))) else if k = j then () else if k + 1ul = j then (if actd then (assert (HH.includes mtr (B.frameOf (V.get hh0 rhs lv))); mt_path_insert mtr p (V.index rhs lv))) else (hash_vv_rv_inv_includes hh0 hs lv (k + 1ul - ofs); assert (HH.includes mtr (B.frameOf (V.get hh0 (V.get hh0 hs lv) (k + 1ul - ofs)))); mt_path_insert mtr p (V.index (V.index hs lv) (k + 1ul - ofs)))
false
Pulse.Checker.VPropEquiv.fsti
Pulse.Checker.VPropEquiv.canon_vprop
val canon_vprop (vp: term) : term
val canon_vprop (vp: term) : term
let canon_vprop (vp:term) : term = list_as_vprop (vprop_as_list vp)
{ "file_name": "lib/steel/pulse/Pulse.Checker.VPropEquiv.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 36, "end_line": 29, "start_col": 0, "start_line": 27 }
(* Copyright 2023 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 Pulse.Checker.VPropEquiv open FStar.List.Tot open Pulse.Syntax open Pulse.Typing open Pulse.Typing.Combinators open Pulse.Checker.Base
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Checker.VPropEquiv.fsti" }
[ { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "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
vp: Pulse.Syntax.Base.term -> Pulse.Syntax.Base.term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Syntax.Base.term", "Pulse.Typing.Combinators.list_as_vprop", "Pulse.Typing.Combinators.vprop_as_list" ]
[]
false
false
false
true
false
let canon_vprop (vp: term) : term =
list_as_vprop (vprop_as_list vp)
false
Pulse.Checker.VPropEquiv.fsti
Pulse.Checker.VPropEquiv.vprop_equiv_typing_fwd
val vprop_equiv_typing_fwd (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g ctxt p) : tot_typing g p tm_vprop
val vprop_equiv_typing_fwd (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g ctxt p) : tot_typing g p tm_vprop
let vprop_equiv_typing_fwd (#g:env) (#ctxt:_) (ctxt_typing:tot_typing g ctxt tm_vprop) (#p:_) (d:vprop_equiv g ctxt p) : tot_typing g p tm_vprop = let fwd, _ = vprop_equiv_typing d in fwd ctxt_typing
{ "file_name": "lib/steel/pulse/Pulse.Checker.VPropEquiv.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 19, "end_line": 73, "start_col": 0, "start_line": 69 }
(* Copyright 2023 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 Pulse.Checker.VPropEquiv open FStar.List.Tot open Pulse.Syntax open Pulse.Typing open Pulse.Typing.Combinators open Pulse.Checker.Base let canon_vprop (vp:term) : term = list_as_vprop (vprop_as_list vp) val ve_unit_r (g:env) (p:term) : vprop_equiv g (tm_star p tm_emp) p val list_as_vprop_append (g:env) (vp0 vp1:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (tm_star (list_as_vprop vp0) (list_as_vprop vp1))) val list_as_vprop_comm (g:env) (vp0 vp1:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (list_as_vprop (vp1 @ vp0))) val list_as_vprop_assoc (g:env) (vp0 vp1 vp2:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ (vp1 @ vp2))) (list_as_vprop ((vp0 @ vp1) @ vp2))) val list_as_vprop_ctx (g:env) (vp0 vp0' vp1 vp1':list term) (_:vprop_equiv g (list_as_vprop vp0) (list_as_vprop vp0')) (_:vprop_equiv g (list_as_vprop vp1) (list_as_vprop vp1')) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (list_as_vprop (vp0' @ vp1'))) val list_as_vprop_singleton (g:env) (p q:term) (d:vprop_equiv g p q) : GTot (vprop_equiv g (list_as_vprop [p]) (list_as_vprop [q])) val vprop_list_equiv (g:env) (vp:term) : GTot (vprop_equiv g vp (canon_vprop vp)) val vprop_equiv_swap_equiv (g:_) (l0 l2:list term) (p q:term) (d_p_q:vprop_equiv g p q) : GTot (vprop_equiv g (list_as_vprop ((l0 @ [q]) @ l2)) (list_as_vprop ([p] @ (l0 @ l2)))) val vprop_equiv_split_frame (g:_) (ctxt req:term) (frame:list term) (d:vprop_equiv g (list_as_vprop (vprop_as_list req @ frame)) (list_as_vprop (vprop_as_list ctxt))) : vprop_equiv g (tm_star req (list_as_vprop frame)) ctxt
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Checker.VPropEquiv.fsti" }
[ { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "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
ctxt_typing: Pulse.Typing.tot_typing g ctxt Pulse.Syntax.Base.tm_vprop -> d: Pulse.Typing.vprop_equiv g ctxt p -> Pulse.Typing.tot_typing g p Pulse.Syntax.Base.tm_vprop
Prims.Tot
[ "total" ]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.vprop_equiv", "FStar.Pervasives.Native.tuple2", "Pulse.Typing.Combinators.vprop_equiv_typing" ]
[]
false
false
false
false
false
let vprop_equiv_typing_fwd (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g ctxt p) : tot_typing g p tm_vprop =
let fwd, _ = vprop_equiv_typing d in fwd ctxt_typing
false
Vale.Wrapper.X64.GCMdecryptOpt.fsti
Vale.Wrapper.X64.GCMdecryptOpt.decrypt_opt_stdcall_st
val decrypt_opt_stdcall_st : a: Vale.AES.AES_common_s.algorithm {a = Vale.AES.AES_common_s.AES_128 \/ a = Vale.AES.AES_common_s.AES_256} -> Type0
let decrypt_opt_stdcall_st (a: algorithm { a = AES_128 \/ a = AES_256 }) = key:Ghost.erased (Seq.seq nat32) -> iv:Ghost.erased supported_iv_LE -> cipher_b:uint8_p -> cipher_len:uint64 -> auth_b:uint8_p -> auth_len:uint64 -> iv_b:uint8_p -> out_b:uint8_p -> tag_b:uint8_p -> keys_b:uint8_p -> hkeys_b:uint8_p -> scratch_b:uint8_p -> Stack UInt64.t (requires fun h0 -> B.disjoint tag_b out_b /\ B.disjoint tag_b hkeys_b /\ B.disjoint tag_b cipher_b /\ B.disjoint tag_b auth_b /\ B.disjoint tag_b iv_b /\ disjoint_or_eq tag_b keys_b /\ B.disjoint iv_b keys_b /\ B.disjoint iv_b out_b /\ B.disjoint iv_b cipher_b /\ B.disjoint iv_b hkeys_b /\ B.disjoint iv_b auth_b /\ B.disjoint out_b keys_b /\ B.disjoint out_b hkeys_b /\ B.disjoint out_b auth_b /\ disjoint_or_eq out_b cipher_b /\ B.disjoint cipher_b keys_b /\ B.disjoint cipher_b hkeys_b /\ B.disjoint cipher_b auth_b /\ disjoint_or_eq keys_b hkeys_b /\ B.disjoint keys_b auth_b /\ B.disjoint hkeys_b auth_b /\ B.disjoint cipher_b scratch_b /\ B.disjoint auth_b scratch_b /\ B.disjoint iv_b scratch_b /\ B.disjoint out_b scratch_b /\ B.disjoint tag_b scratch_b /\ B.disjoint keys_b scratch_b /\ B.disjoint hkeys_b scratch_b /\ B.live h0 auth_b /\ B.live h0 keys_b /\ B.live h0 iv_b /\ B.live h0 hkeys_b /\ B.live h0 out_b /\ B.live h0 cipher_b /\ B.live h0 tag_b /\ B.live h0 scratch_b /\ B.length auth_b = UInt64.v auth_len /\ B.length iv_b = 16 /\ B.length cipher_b = UInt64.v cipher_len /\ B.length out_b = B.length cipher_b /\ B.length hkeys_b = 128 /\ B.length tag_b == 16 /\ B.length keys_b = Vale.Wrapper.X64.AES.key_offset a /\ B.length scratch_b = 176 /\ aesni_enabled /\ pclmulqdq_enabled /\ avx_enabled /\ sse_enabled /\ movbe_enabled /\ is_aes_key_LE a (Ghost.reveal key) /\ (Seq.equal (B.as_seq h0 keys_b) (seq_nat8_to_seq_uint8 (le_seq_quad32_to_bytes (key_to_round_keys_LE a (Ghost.reveal key))))) /\ hkeys_reqs_pub (le_bytes_to_seq_quad32 (seq_uint8_to_seq_nat8 (B.as_seq h0 hkeys_b))) (reverse_bytes_quad32 (aes_encrypt_LE a (Ghost.reveal key) (Mkfour 0 0 0 0))) /\ (le_bytes_to_quad32 (seq_uint8_to_seq_nat8 (B.as_seq h0 iv_b)) == compute_iv_BE (aes_encrypt_LE a (Ghost.reveal key) (Mkfour 0 0 0 0)) (Ghost.reveal iv)) ) (ensures fun h0 c h1 -> B.modifies (B.loc_union (B.loc_buffer scratch_b) (B.loc_union (B.loc_buffer iv_b) (B.loc_buffer out_b))) h0 h1 /\ (let cipher = seq_uint8_to_seq_nat8 (B.as_seq h0 cipher_b) in let auth = seq_uint8_to_seq_nat8 (B.as_seq h0 auth_b) in let expected_tag = seq_uint8_to_seq_nat8 (B.as_seq h0 tag_b) in let plain, result = gcm_decrypt_LE a (seq_nat32_to_seq_nat8_LE (Ghost.reveal key)) (Ghost.reveal iv) cipher auth expected_tag in Seq.equal (seq_uint8_to_seq_nat8 (B.as_seq h1 out_b)) plain /\ (UInt64.v c = 0) == result) )
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCMdecryptOpt.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 3, "end_line": 137, "start_col": 0, "start_line": 63 }
module Vale.Wrapper.X64.GCMdecryptOpt 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 Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux3 (b:uint8_p) (n:nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16 let length_aux4 (b:uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux5 (b:uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db #set-options "--z3rlimit 30 --max_fuel 0 --max_ifuel 0"
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Wrapper.X64.AES.fsti.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.AsLowStar.MemoryHelpers.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GHash_s.fst.checked", "Vale.AES.GCTR_s.fst.checked", "Vale.AES.GCTR.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.GCM_helpers.fsti.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.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCMdecryptOpt.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCTR_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GHash_s", "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.AES.GCM_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_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": false, "full_module": "Vale.AsLowStar.MemoryHelpers", "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": 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": 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": 30, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Vale.AES.AES_common_s.algorithm {a = Vale.AES.AES_common_s.AES_128 \/ a = Vale.AES.AES_common_s.AES_256} -> Type0
Prims.Tot
[ "total" ]
[]
[ "Vale.AES.AES_common_s.algorithm", "Prims.l_or", "Prims.b2t", "Prims.op_Equality", "Vale.AES.AES_common_s.AES_128", "Vale.AES.AES_common_s.AES_256", "FStar.Ghost.erased", "FStar.Seq.Base.seq", "Vale.Def.Types_s.nat32", "Vale.AES.GCM_s.supported_iv_LE", "Vale.Wrapper.X64.GCMdecryptOpt.uint8_p", "Vale.Wrapper.X64.GCMdecryptOpt.uint64", "FStar.UInt64.t", "FStar.Monotonic.HyperStack.mem", "Prims.l_and", "LowStar.Monotonic.Buffer.disjoint", "FStar.UInt8.t", "LowStar.Buffer.trivial_preorder", "Vale.Wrapper.X64.GCMdecryptOpt.disjoint_or_eq", "LowStar.Monotonic.Buffer.live", "Prims.int", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt64.n", "LowStar.Monotonic.Buffer.length", "FStar.UInt64.v", "Prims.nat", "Prims.eq2", "Vale.Wrapper.X64.AES.key_offset", "Vale.X64.CPU_Features_s.aesni_enabled", "Vale.X64.CPU_Features_s.pclmulqdq_enabled", "Vale.X64.CPU_Features_s.avx_enabled", "Vale.X64.CPU_Features_s.sse_enabled", "Vale.X64.CPU_Features_s.movbe_enabled", "Vale.AES.AES_s.is_aes_key_LE", "FStar.Ghost.reveal", "FStar.Seq.Base.equal", "LowStar.Monotonic.Buffer.as_seq", "Vale.Def.Words.Seq_s.seq_nat8_to_seq_uint8", "Vale.Def.Types_s.le_seq_quad32_to_bytes", "Vale.AES.AES_s.key_to_round_keys_LE", "Vale.AES.OptPublic.hkeys_reqs_pub", "Vale.Def.Types_s.le_bytes_to_seq_quad32", "Vale.Def.Words.Seq_s.seq_uint8_to_seq_nat8", "Vale.Def.Types_s.reverse_bytes_quad32", "Vale.AES.AES_s.aes_encrypt_LE", "Vale.Def.Words_s.Mkfour", "Vale.Def.Types_s.quad32", "Vale.Def.Types_s.le_bytes_to_quad32", "Vale.AES.GCM_s.compute_iv_BE", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_union", "LowStar.Monotonic.Buffer.loc_buffer", "Vale.Def.Types_s.nat8", "Prims.bool", "Vale.Def.Words_s.nat8", "Prims.logical", "FStar.Pervasives.Native.tuple2", "Vale.AES.GCM_s.gcm_decrypt_LE", "Vale.Def.Words.Seq_s.seq_nat32_to_seq_nat8_LE" ]
[]
false
false
false
false
true
let decrypt_opt_stdcall_st (a: algorithm{a = AES_128 \/ a = AES_256}) =
key: Ghost.erased (Seq.seq nat32) -> iv: Ghost.erased supported_iv_LE -> cipher_b: uint8_p -> cipher_len: uint64 -> auth_b: uint8_p -> auth_len: uint64 -> iv_b: uint8_p -> out_b: uint8_p -> tag_b: uint8_p -> keys_b: uint8_p -> hkeys_b: uint8_p -> scratch_b: uint8_p -> Stack UInt64.t (requires fun h0 -> B.disjoint tag_b out_b /\ B.disjoint tag_b hkeys_b /\ B.disjoint tag_b cipher_b /\ B.disjoint tag_b auth_b /\ B.disjoint tag_b iv_b /\ disjoint_or_eq tag_b keys_b /\ B.disjoint iv_b keys_b /\ B.disjoint iv_b out_b /\ B.disjoint iv_b cipher_b /\ B.disjoint iv_b hkeys_b /\ B.disjoint iv_b auth_b /\ B.disjoint out_b keys_b /\ B.disjoint out_b hkeys_b /\ B.disjoint out_b auth_b /\ disjoint_or_eq out_b cipher_b /\ B.disjoint cipher_b keys_b /\ B.disjoint cipher_b hkeys_b /\ B.disjoint cipher_b auth_b /\ disjoint_or_eq keys_b hkeys_b /\ B.disjoint keys_b auth_b /\ B.disjoint hkeys_b auth_b /\ B.disjoint cipher_b scratch_b /\ B.disjoint auth_b scratch_b /\ B.disjoint iv_b scratch_b /\ B.disjoint out_b scratch_b /\ B.disjoint tag_b scratch_b /\ B.disjoint keys_b scratch_b /\ B.disjoint hkeys_b scratch_b /\ B.live h0 auth_b /\ B.live h0 keys_b /\ B.live h0 iv_b /\ B.live h0 hkeys_b /\ B.live h0 out_b /\ B.live h0 cipher_b /\ B.live h0 tag_b /\ B.live h0 scratch_b /\ B.length auth_b = UInt64.v auth_len /\ B.length iv_b = 16 /\ B.length cipher_b = UInt64.v cipher_len /\ B.length out_b = B.length cipher_b /\ B.length hkeys_b = 128 /\ B.length tag_b == 16 /\ B.length keys_b = Vale.Wrapper.X64.AES.key_offset a /\ B.length scratch_b = 176 /\ aesni_enabled /\ pclmulqdq_enabled /\ avx_enabled /\ sse_enabled /\ movbe_enabled /\ is_aes_key_LE a (Ghost.reveal key) /\ (Seq.equal (B.as_seq h0 keys_b) (seq_nat8_to_seq_uint8 (le_seq_quad32_to_bytes (key_to_round_keys_LE a (Ghost.reveal key))))) /\ hkeys_reqs_pub (le_bytes_to_seq_quad32 (seq_uint8_to_seq_nat8 (B.as_seq h0 hkeys_b))) (reverse_bytes_quad32 (aes_encrypt_LE a (Ghost.reveal key) (Mkfour 0 0 0 0))) /\ (le_bytes_to_quad32 (seq_uint8_to_seq_nat8 (B.as_seq h0 iv_b)) == compute_iv_BE (aes_encrypt_LE a (Ghost.reveal key) (Mkfour 0 0 0 0)) (Ghost.reveal iv))) (ensures fun h0 c h1 -> B.modifies (B.loc_union (B.loc_buffer scratch_b) (B.loc_union (B.loc_buffer iv_b) (B.loc_buffer out_b))) h0 h1 /\ (let cipher = seq_uint8_to_seq_nat8 (B.as_seq h0 cipher_b) in let auth = seq_uint8_to_seq_nat8 (B.as_seq h0 auth_b) in let expected_tag = seq_uint8_to_seq_nat8 (B.as_seq h0 tag_b) in let plain, result = gcm_decrypt_LE a (seq_nat32_to_seq_nat8_LE (Ghost.reveal key)) (Ghost.reveal iv) cipher auth expected_tag in Seq.equal (seq_uint8_to_seq_nat8 (B.as_seq h1 out_b)) plain /\ (UInt64.v c = 0) == result))
false
Pulse.Checker.VPropEquiv.fsti
Pulse.Checker.VPropEquiv.vprop_equiv_typing_bk
val vprop_equiv_typing_bk (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g p ctxt) : tot_typing g p tm_vprop
val vprop_equiv_typing_bk (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g p ctxt) : tot_typing g p tm_vprop
let vprop_equiv_typing_bk (#g:env) (#ctxt:_) (ctxt_typing:tot_typing g ctxt tm_vprop) (#p:_) (d:vprop_equiv g p ctxt) : tot_typing g p tm_vprop = let _, bk = vprop_equiv_typing d in bk ctxt_typing
{ "file_name": "lib/steel/pulse/Pulse.Checker.VPropEquiv.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 18, "end_line": 80, "start_col": 0, "start_line": 76 }
(* Copyright 2023 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 Pulse.Checker.VPropEquiv open FStar.List.Tot open Pulse.Syntax open Pulse.Typing open Pulse.Typing.Combinators open Pulse.Checker.Base let canon_vprop (vp:term) : term = list_as_vprop (vprop_as_list vp) val ve_unit_r (g:env) (p:term) : vprop_equiv g (tm_star p tm_emp) p val list_as_vprop_append (g:env) (vp0 vp1:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (tm_star (list_as_vprop vp0) (list_as_vprop vp1))) val list_as_vprop_comm (g:env) (vp0 vp1:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (list_as_vprop (vp1 @ vp0))) val list_as_vprop_assoc (g:env) (vp0 vp1 vp2:list term) : GTot (vprop_equiv g (list_as_vprop (vp0 @ (vp1 @ vp2))) (list_as_vprop ((vp0 @ vp1) @ vp2))) val list_as_vprop_ctx (g:env) (vp0 vp0' vp1 vp1':list term) (_:vprop_equiv g (list_as_vprop vp0) (list_as_vprop vp0')) (_:vprop_equiv g (list_as_vprop vp1) (list_as_vprop vp1')) : GTot (vprop_equiv g (list_as_vprop (vp0 @ vp1)) (list_as_vprop (vp0' @ vp1'))) val list_as_vprop_singleton (g:env) (p q:term) (d:vprop_equiv g p q) : GTot (vprop_equiv g (list_as_vprop [p]) (list_as_vprop [q])) val vprop_list_equiv (g:env) (vp:term) : GTot (vprop_equiv g vp (canon_vprop vp)) val vprop_equiv_swap_equiv (g:_) (l0 l2:list term) (p q:term) (d_p_q:vprop_equiv g p q) : GTot (vprop_equiv g (list_as_vprop ((l0 @ [q]) @ l2)) (list_as_vprop ([p] @ (l0 @ l2)))) val vprop_equiv_split_frame (g:_) (ctxt req:term) (frame:list term) (d:vprop_equiv g (list_as_vprop (vprop_as_list req @ frame)) (list_as_vprop (vprop_as_list ctxt))) : vprop_equiv g (tm_star req (list_as_vprop frame)) ctxt let vprop_equiv_typing_fwd (#g:env) (#ctxt:_) (ctxt_typing:tot_typing g ctxt tm_vprop) (#p:_) (d:vprop_equiv g ctxt p) : tot_typing g p tm_vprop = let fwd, _ = vprop_equiv_typing d in fwd ctxt_typing
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Checker.VPropEquiv.fsti" }
[ { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "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
ctxt_typing: Pulse.Typing.tot_typing g ctxt Pulse.Syntax.Base.tm_vprop -> d: Pulse.Typing.vprop_equiv g p ctxt -> Pulse.Typing.tot_typing g p Pulse.Syntax.Base.tm_vprop
Prims.Tot
[ "total" ]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.vprop_equiv", "FStar.Pervasives.Native.tuple2", "Pulse.Typing.Combinators.vprop_equiv_typing" ]
[]
false
false
false
false
false
let vprop_equiv_typing_bk (#g: env) (#ctxt: _) (ctxt_typing: tot_typing g ctxt tm_vprop) (#p: _) (d: vprop_equiv g p ctxt) : tot_typing g p tm_vprop =
let _, bk = vprop_equiv_typing d in bk ctxt_typing
false
Steel.ST.Array.Swap.fst
Steel.ST.Array.Swap.array_pts_to
val array_pts_to (#t: Type) (a: array t) : Tot (Gen.array_pts_to_t t)
val array_pts_to (#t: Type) (a: array t) : Tot (Gen.array_pts_to_t t)
let array_pts_to (#t: Type) (a: array t) : Tot (Gen.array_pts_to_t t) = fun s -> pts_to a full_perm (Ghost.reveal s)
{ "file_name": "lib/steel/Steel.ST.Array.Swap.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 46, "end_line": 9, "start_col": 0, "start_line": 8 }
module Steel.ST.Array.Swap open Steel.ST.GenElim open Steel.ST.Array // for pts_to module Gen = Steel.ST.GenArraySwap
{ "checked_file": "/", "dependencies": [ "Steel.ST.GenElim.fsti.checked", "Steel.ST.GenArraySwap.fsti.checked", "Steel.ST.Array.fsti.checked", "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": true, "source_file": "Steel.ST.Array.Swap.fst" }
[ { "abbrev": false, "full_module": "Steel.ST.Array // for pts_to", "short_module": null }, { "abbrev": true, "full_module": "Steel.ST.GenArraySwap", "short_module": "Gen" }, { "abbrev": false, "full_module": "Steel.ST.Array", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST.GenElim", "short_module": null }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "SZ" }, { "abbrev": false, "full_module": "Steel.ST.Array", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST.Array", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST.Array", "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.Array.array t -> Steel.ST.GenArraySwap.array_pts_to_t t
Prims.Tot
[ "total" ]
[]
[ "Steel.ST.Array.array", "FStar.Ghost.erased", "FStar.Seq.Base.seq", "Steel.ST.Array.pts_to", "Steel.FractionalPermission.full_perm", "FStar.Ghost.reveal", "Steel.Effect.Common.vprop", "Steel.ST.GenArraySwap.array_pts_to_t" ]
[]
false
false
false
true
false
let array_pts_to (#t: Type) (a: array t) : Tot (Gen.array_pts_to_t t) =
fun s -> pts_to a full_perm (Ghost.reveal s)
false
Hacl.Salsa20.fst
Hacl.Salsa20.salsa20_key_block0
val salsa20_key_block0: out:lbuffer uint8 64ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.Salsa20.salsa20_key_block0 (as_seq h0 key) (as_seq h0 n))
val salsa20_key_block0: out:lbuffer uint8 64ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.Salsa20.salsa20_key_block0 (as_seq h0 key) (as_seq h0 n))
let salsa20_key_block0 out key n = Hacl.Impl.Salsa20.salsa20_key_block0 out key n
{ "file_name": "code/salsa20/Hacl.Salsa20.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 48, "end_line": 53, "start_col": 0, "start_line": 52 }
module Hacl.Salsa20 open FStar.HyperStack open FStar.HyperStack.All open Lib.IntTypes open Lib.Buffer module Spec = Spec.Salsa20 val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text)) let salsa20_encrypt len out text key n ctr = Hacl.Impl.Salsa20.salsa20_encrypt len out text key n ctr val salsa20_decrypt: len:size_t -> out:lbuffer uint8 len -> cipher:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h cipher /\ live h out /\ eq_or_disjoint cipher out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_decrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 cipher)) let salsa20_decrypt len out cipher key n ctr = Hacl.Impl.Salsa20.salsa20_decrypt len out cipher key n ctr val salsa20_key_block0: out:lbuffer uint8 64ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.Salsa20.salsa20_key_block0 (as_seq h0 key) (as_seq h0 n))
{ "checked_file": "/", "dependencies": [ "Spec.Salsa20.fst.checked", "prims.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Impl.Salsa20.fst.checked", "Hacl.Impl.HSalsa20.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Salsa20.fst" }
[ { "abbrev": true, "full_module": "Spec.Salsa20", "short_module": "Spec" }, { "abbrev": false, "full_module": "Lib.Buffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
out: Lib.Buffer.lbuffer Lib.IntTypes.uint8 64ul -> key: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul -> n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 8ul -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "FStar.UInt32.__uint_to_t", "Hacl.Impl.Salsa20.salsa20_key_block0", "Prims.unit" ]
[]
false
true
false
false
false
let salsa20_key_block0 out key n =
Hacl.Impl.Salsa20.salsa20_key_block0 out key n
false
Hacl.Salsa20.fst
Hacl.Salsa20.salsa20_decrypt
val salsa20_decrypt: len:size_t -> out:lbuffer uint8 len -> cipher:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h cipher /\ live h out /\ eq_or_disjoint cipher out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_decrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 cipher))
val salsa20_decrypt: len:size_t -> out:lbuffer uint8 len -> cipher:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h cipher /\ live h out /\ eq_or_disjoint cipher out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_decrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 cipher))
let salsa20_decrypt len out cipher key n ctr = Hacl.Impl.Salsa20.salsa20_decrypt len out cipher key n ctr
{ "file_name": "code/salsa20/Hacl.Salsa20.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 60, "end_line": 40, "start_col": 0, "start_line": 39 }
module Hacl.Salsa20 open FStar.HyperStack open FStar.HyperStack.All open Lib.IntTypes open Lib.Buffer module Spec = Spec.Salsa20 val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text)) let salsa20_encrypt len out text key n ctr = Hacl.Impl.Salsa20.salsa20_encrypt len out text key n ctr val salsa20_decrypt: len:size_t -> out:lbuffer uint8 len -> cipher:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h cipher /\ live h out /\ eq_or_disjoint cipher out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_decrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 cipher))
{ "checked_file": "/", "dependencies": [ "Spec.Salsa20.fst.checked", "prims.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Impl.Salsa20.fst.checked", "Hacl.Impl.HSalsa20.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Salsa20.fst" }
[ { "abbrev": true, "full_module": "Spec.Salsa20", "short_module": "Spec" }, { "abbrev": false, "full_module": "Lib.Buffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
len: Lib.IntTypes.size_t -> out: Lib.Buffer.lbuffer Lib.IntTypes.uint8 len -> cipher: Lib.Buffer.lbuffer Lib.IntTypes.uint8 len -> key: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul -> n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 8ul -> ctr: Lib.IntTypes.size_t -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Lib.IntTypes.size_t", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "FStar.UInt32.__uint_to_t", "Hacl.Impl.Salsa20.salsa20_decrypt", "Prims.unit" ]
[]
false
true
false
false
false
let salsa20_decrypt len out cipher key n ctr =
Hacl.Impl.Salsa20.salsa20_decrypt len out cipher key n ctr
false
Hacl.Salsa20.fst
Hacl.Salsa20.salsa20_encrypt
val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text))
val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text))
let salsa20_encrypt len out text key n ctr = Hacl.Impl.Salsa20.salsa20_encrypt len out text key n ctr
{ "file_name": "code/salsa20/Hacl.Salsa20.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 58, "end_line": 24, "start_col": 0, "start_line": 23 }
module Hacl.Salsa20 open FStar.HyperStack open FStar.HyperStack.All open Lib.IntTypes open Lib.Buffer module Spec = Spec.Salsa20 val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text))
{ "checked_file": "/", "dependencies": [ "Spec.Salsa20.fst.checked", "prims.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Impl.Salsa20.fst.checked", "Hacl.Impl.HSalsa20.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Salsa20.fst" }
[ { "abbrev": true, "full_module": "Spec.Salsa20", "short_module": "Spec" }, { "abbrev": false, "full_module": "Lib.Buffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
len: Lib.IntTypes.size_t -> out: Lib.Buffer.lbuffer Lib.IntTypes.uint8 len -> text: Lib.Buffer.lbuffer Lib.IntTypes.uint8 len -> key: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul -> n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 8ul -> ctr: Lib.IntTypes.size_t -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Lib.IntTypes.size_t", "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "FStar.UInt32.__uint_to_t", "Hacl.Impl.Salsa20.salsa20_encrypt", "Prims.unit" ]
[]
false
true
false
false
false
let salsa20_encrypt len out text key n ctr =
Hacl.Impl.Salsa20.salsa20_encrypt len out text key n ctr
false
Hacl.Salsa20.fst
Hacl.Salsa20.hsalsa20
val hsalsa20: out:lbuffer uint8 32ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.hsalsa20 (as_seq h0 key) (as_seq h0 n))
val hsalsa20: out:lbuffer uint8 32ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.hsalsa20 (as_seq h0 key) (as_seq h0 n))
let hsalsa20 out key n = Hacl.Impl.HSalsa20.hsalsa20 out key n
{ "file_name": "code/salsa20/Hacl.Salsa20.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 66, "start_col": 0, "start_line": 65 }
module Hacl.Salsa20 open FStar.HyperStack open FStar.HyperStack.All open Lib.IntTypes open Lib.Buffer module Spec = Spec.Salsa20 val salsa20_encrypt: len:size_t -> out:lbuffer uint8 len -> text:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h text /\ live h out /\ eq_or_disjoint text out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_encrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 text)) let salsa20_encrypt len out text key n ctr = Hacl.Impl.Salsa20.salsa20_encrypt len out text key n ctr val salsa20_decrypt: len:size_t -> out:lbuffer uint8 len -> cipher:lbuffer uint8 len -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> ctr:size_t -> Stack unit (requires fun h -> live h key /\ live h n /\ live h cipher /\ live h out /\ eq_or_disjoint cipher out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.salsa20_decrypt_bytes (as_seq h0 key) (as_seq h0 n) (v ctr) (as_seq h0 cipher)) let salsa20_decrypt len out cipher key n ctr = Hacl.Impl.Salsa20.salsa20_decrypt len out cipher key n ctr val salsa20_key_block0: out:lbuffer uint8 64ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 8ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.Salsa20.salsa20_key_block0 (as_seq h0 key) (as_seq h0 n)) let salsa20_key_block0 out key n = Hacl.Impl.Salsa20.salsa20_key_block0 out key n val hsalsa20: out:lbuffer uint8 32ul -> key:lbuffer uint8 32ul -> n:lbuffer uint8 16ul -> Stack unit (requires fun h -> live h key /\ live h n /\ live h out) (ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\ as_seq h1 out == Spec.hsalsa20 (as_seq h0 key) (as_seq h0 n))
{ "checked_file": "/", "dependencies": [ "Spec.Salsa20.fst.checked", "prims.fst.checked", "Lib.IntTypes.fsti.checked", "Lib.Buffer.fsti.checked", "Hacl.Impl.Salsa20.fst.checked", "Hacl.Impl.HSalsa20.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.HyperStack.All.fst.checked", "FStar.HyperStack.fst.checked" ], "interface_file": false, "source_file": "Hacl.Salsa20.fst" }
[ { "abbrev": true, "full_module": "Spec.Salsa20", "short_module": "Spec" }, { "abbrev": false, "full_module": "Lib.Buffer", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack.All", "short_module": null }, { "abbrev": false, "full_module": "FStar.HyperStack", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "short_module": null }, { "abbrev": false, "full_module": "Hacl", "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": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
out: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul -> key: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul -> n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul -> FStar.HyperStack.ST.Stack Prims.unit
FStar.HyperStack.ST.Stack
[]
[]
[ "Lib.Buffer.lbuffer", "Lib.IntTypes.uint8", "FStar.UInt32.__uint_to_t", "Hacl.Impl.HSalsa20.hsalsa20", "Prims.unit" ]
[]
false
true
false
false
false
let hsalsa20 out key n =
Hacl.Impl.HSalsa20.hsalsa20 out key n
false
Vale.AES.PPC64LE.AES256.fst
Vale.AES.PPC64LE.AES256.va_qcode_AES256EncryptBlock_6way
val va_qcode_AES256EncryptBlock_6way (va_mods: va_mods_t) (in1 in2 in3 in4 in5 in6: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock_6way ()))
val va_qcode_AES256EncryptBlock_6way (va_mods: va_mods_t) (in1 in2 in3 in4 in5 in6: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock_6way ()))
let va_qcode_AES256EncryptBlock_6way (va_mods:va_mods_t) (in1:quad32) (in2:quad32) (in3:quad32) (in4:quad32) (in5:quad32) (in6:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock_6way ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 370 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init1:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in1 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 371 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init2:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in2 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 372 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init3:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in3 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 373 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init4:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in4 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 374 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init5:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in5 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 375 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init6:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor in6 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 377 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 378 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 379 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 380 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 381 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 382 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 383 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 384 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 385 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 1 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 386 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 2 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 387 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 3 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 388 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 4 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 389 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 5 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 390 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 6 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 391 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 7 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 392 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 8 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 393 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 9 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 394 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 10 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 11 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 12 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 13 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 403 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 404 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 405 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 408 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 409 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))))))))))))))))))
{ "file_name": "obj/Vale.AES.PPC64LE.AES256.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 1331, "start_col": 0, "start_line": 1200 }
module Vale.AES.PPC64LE.AES256 open Vale.Def.Opaque_s open Vale.Def.Types_s open FStar.Seq open Vale.AES.AES_BE_s open Vale.PPC64LE.Machine_s open Vale.PPC64LE.Memory open Vale.PPC64LE.State open Vale.PPC64LE.Decls open Vale.PPC64LE.InsBasic open Vale.PPC64LE.InsMem open Vale.PPC64LE.InsVector open Vale.PPC64LE.QuickCode open Vale.PPC64LE.QuickCodes open Vale.Arch.Types open Vale.AES.AES256_helpers_BE #reset-options "--z3rlimit 20" //-- KeyExpansionRoundEven256 val va_code_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundEven256 round rcon = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 4) 8) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_CCons (va_code_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ()))))))))))))))))))) val va_codegen_success_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundEven256 round rcon = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 4) 8) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_pbool_and (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_pbool_and (va_codegen_success_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ())))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundEven256 (va_mods:va_mods_t) (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (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 67 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 68 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 4) 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 69 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 70 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) rcon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 71 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Mtvsrws (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 72 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 73 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_RotWord (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 74 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 75 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 76 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 78 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 1) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 82 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 85 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg27:Vale.Def.Types_s.nat8) = rcon in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 86 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.lemma_shl_rcon va_arg27) (let (va_arg26:Prims.int) = round + 1 in let (va_arg25:Vale.Def.Types_s.nat32) = rcon in let (va_arg24:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in let (va_arg23:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 87 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg23 va_arg24 va_arg25 va_arg26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 88 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (())))))))))))))))))))))))) val va_lemma_KeyExpansionRoundEven256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundEven256 va_b0 va_s0 round rcon dst key = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundEven256 va_mods round rcon dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundEven256 round rcon) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 43 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 63 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 64 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 65 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 == 0 /\ rcon == Vale.AES.AES_common_s.aes_rcon ((round + 1) `op_Division` 2 - 1) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 1 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 1 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundEven256 : round:nat8 -> rcon:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundEven256 round rcon dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundEven256 (va_code_KeyExpansionRoundEven256 round rcon) va_s0 round rcon dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundEven256 (round:nat8) (rcon:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundEven256 round rcon)) = (va_QProc (va_code_KeyExpansionRoundEven256 round rcon) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundEven256 round rcon dst key) (va_wpProof_KeyExpansionRoundEven256 round rcon dst key)) //-- //-- KeyExpansionRoundOdd256 val va_code_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansionRoundOdd256 round = (va_Block (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0) 0) (va_CCons (va_code_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CNil ())))))))))))))) val va_codegen_success_KeyExpansionRoundOdd256 : round:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansionRoundOdd256 round = (va_pbool_and (va_codegen_success_Vspltisw (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansionRoundOdd256 (va_mods:va_mods_t) (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (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 114 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 115 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsbox (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 116 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vspltw (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 117 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 121 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 3) 12) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 122 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 123 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 124 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` (round + 1))) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 125 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret dst (round + 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 127 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.Def.Types_s.quad32_xor_reveal ()) (let (va_arg23:Prims.int) = round + 1 in let (va_arg22:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg21:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 128 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_simd_round_key va_arg21 va_arg22 0 va_arg23) (let (va_arg20:Prims.int) = round + 1 in let (va_arg19:Vale.Def.Types_s.quad32) = va_get_vec 1 va_old_s in let (va_arg18:Vale.Def.Types_s.quad32) = va_get_vec 3 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 129 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_round_key_256_rcon_odd va_arg18 va_arg19 0 va_arg20) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 130 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QEmpty (()))))))))))))))))))) val va_lemma_KeyExpansionRoundOdd256 : va_b0:va_code -> va_s0:va_state -> round:nat8 -> dst:buffer128 -> key:(seq nat32) -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundOdd256 round) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) /\ va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansionRoundOdd256 va_b0 va_s0 round dst key = let (va_mods:va_mods_t) = [va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansionRoundOdd256 va_mods round dst key in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansionRoundOdd256 round) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 102 column 64 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 110 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM))) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 111 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 112 column 82 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (1 <= round /\ round < 14) /\ (round + 1) `op_Modulus` 2 =!= 0 /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key (round - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key round /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) . let va_sM = va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ va_get_vec 3 va_sM == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (round + 1) (va_get_mem_heaplet 1 va_sM)) /\ va_get_vec 3 va_sM == Vale.AES.AES256_helpers_BE.expand_key_256 key (round + 1) /\ Vale.PPC64LE.Decls.modifies_buffer_specific128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) (round + 1) (round + 1) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundOdd256 : round:nat8 -> dst:buffer128 -> key:(seq nat32) -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundOdd256 round dst key va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundOdd256 round dst key va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundOdd256 (va_code_KeyExpansionRoundOdd256 round) va_s0 round dst key in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundOdd256 (round:nat8) (dst:buffer128) (key:(seq nat32)) : (va_quickCode unit (va_code_KeyExpansionRoundOdd256 round)) = (va_QProc (va_code_KeyExpansionRoundOdd256 round) ([va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundOdd256 round dst key) (va_wpProof_KeyExpansionRoundOdd256 round dst key)) //-- //-- KeyExpansionRoundUnrolledRecursive256 val va_code_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_code(decreases %[n]) [@ "opaque_to_smt"] let rec va_code_KeyExpansionRoundUnrolledRecursive256 n = (va_Block (va_CCons (if (1 < n && n <= 14) then va_Block (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_CCons (if (n `op_Modulus` 2 = 0) then va_Block (va_CCons (va_code_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_CNil ())) else va_Block (va_CCons (va_code_KeyExpansionRoundOdd256 (n - 1)) (va_CNil ()))) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))) val va_codegen_success_KeyExpansionRoundUnrolledRecursive256 : n:int -> Tot va_pbool(decreases %[n]) [@ "opaque_to_smt"] let rec va_codegen_success_KeyExpansionRoundUnrolledRecursive256 n = (va_pbool_and (if (1 < n && n <= 14) then va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 (n - 1)) (va_pbool_and (if (n `op_Modulus` 2 = 0) then va_pbool_and (va_codegen_success_KeyExpansionRoundEven256 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1))) (va_ttrue ()) else va_pbool_and (va_codegen_success_KeyExpansionRoundOdd256 (n - 1)) (va_ttrue ())) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())) val va_lemma_KeyExpansionRoundUnrolledRecursive256 : va_b0:va_code -> va_s0:va_state -> key:(seq nat32) -> dst:buffer128 -> n:int -> Ghost (va_state & va_fuel)(decreases %[n]) (requires (va_require_total va_b0 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 /\ va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 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.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == (if (n `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == (if ((n - 1) `op_Modulus` 2 = 0) then va_get_vec 1 va_sM else va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) /\ va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) [@"opaque_to_smt"] let rec va_lemma_KeyExpansionRoundUnrolledRecursive256 va_b0 va_s0 key dst n = va_reveal_opaque (`%va_code_KeyExpansionRoundUnrolledRecursive256) (va_code_KeyExpansionRoundUnrolledRecursive256 n); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let va_b2 = va_tl va_b1 in let va_c2 = va_hd va_b1 in let (va_fc2, va_s2) = ( if (1 < n && n <= 14) then ( let va_b3 = va_get_block va_c2 in let (va_s4, va_fc4) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_hd va_b3) va_s0 key dst (n - 1) in let va_b4 = va_tl va_b3 in let (old_mem:vale_heap) = va_get_mem_heaplet 1 va_s4 in let va_b6 = va_tl va_b4 in let va_c6 = va_hd va_b4 in let (va_fc6, va_s6) = ( if (n `op_Modulus` 2 = 0) then ( let va_b7 = va_get_block va_c6 in let (va_s8, va_fc8) = va_lemma_KeyExpansionRoundEven256 (va_hd va_b7) va_s4 (n - 1) (Vale.AES.AES_common_s.aes_rcon (n `op_Division` 2 - 1)) dst key in let va_b8 = va_tl va_b7 in let (va_s6, va_f8) = va_lemma_empty_total va_s8 va_b8 in let va_fc6 = va_lemma_merge_total va_b7 va_s4 va_fc8 va_s8 va_f8 va_s6 in (va_fc6, va_s6) ) else ( let va_b9 = va_get_block va_c6 in let (va_s10, va_fc10) = va_lemma_KeyExpansionRoundOdd256 (va_hd va_b9) va_s4 (n - 1) dst key in let va_b10 = va_tl va_b9 in let (va_s6, va_f10) = va_lemma_empty_total va_s10 va_b10 in let va_fc6 = va_lemma_merge_total va_b9 va_s4 va_fc10 va_s10 va_f10 va_s6 in (va_fc6, va_s6) ) ) in assert (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_s6)))}0 <= j /\ j < n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_s6)) == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j old_mem)); let (va_s2, va_f6) = va_lemma_empty_total va_s6 va_b6 in let va_f4 = va_lemma_merge_total va_b4 va_s4 va_fc6 va_s6 va_f6 va_s2 in let va_fc2 = va_lemma_merge_total va_b3 va_s0 va_fc4 va_s4 va_f4 va_s2 in (va_fc2, va_s2) ) else ( let va_b12 = va_get_block va_c2 in let (va_s2, va_fc2) = va_lemma_empty_total va_s0 va_b12 in (va_fc2, va_s2) ) ) in let (va_sM, va_f2) = va_lemma_empty_total va_s2 va_b2 in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) dst 15 (va_get_mem_layout va_s0) Secret /\ (0 < n /\ n <= 14) /\ Vale.AES.AES_BE_s.is_aes_key_word AES_256 key /\ va_get_vec 1 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 0 /\ va_get_vec 3 va_s0 == Vale.AES.AES256_helpers_BE.expand_key_256 key 1 /\ va_get_vec 1 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 0 (va_get_mem_heaplet 1 va_s0)) /\ va_get_vec 3 va_s0 == Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst 1 (va_get_mem_heaplet 1 va_s0)) /\ va_get_reg 3 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 dst (va_get_mem_heaplet 1 va_s0) /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) . let va_sM = va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) dst 15 (va_get_mem_layout va_sM) Secret /\ Vale.PPC64LE.Decls.modifies_buffer128 dst (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst n (va_get_mem_heaplet 1 va_sM)) == va_if (n `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst (n - 1) (va_get_mem_heaplet 1 va_sM)) == va_if ((n - 1) `op_Modulus` 2 = 0) (fun _ -> va_get_vec 1 va_sM) (fun _ -> va_get_vec 3 va_sM) /\ (forall j . {:pattern(reverse_bytes_quad32 (buffer128_read dst j (va_get_mem_heaplet 1 va_sM)))}0 <= j /\ j <= n ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read dst j (va_get_mem_heaplet 1 va_sM)) == Vale.AES.AES256_helpers_BE.expand_key_256 key j) ==> va_k va_sM (()))) val va_wpProof_KeyExpansionRoundUnrolledRecursive256 : key:(seq nat32) -> dst:buffer128 -> n:int -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansionRoundUnrolledRecursive256 (va_code_KeyExpansionRoundUnrolledRecursive256 n) va_s0 key dst n in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; 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_KeyExpansionRoundUnrolledRecursive256 (key:(seq nat32)) (dst:buffer128) (n:int) : (va_quickCode unit (va_code_KeyExpansionRoundUnrolledRecursive256 n)) = (va_QProc (va_code_KeyExpansionRoundUnrolledRecursive256 n) ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_KeyExpansionRoundUnrolledRecursive256 key dst n) (va_wpProof_KeyExpansionRoundUnrolledRecursive256 key dst n)) //-- //-- KeyExpansion256Stdcall [@ "opaque_to_smt" va_qattr] let va_code_KeyExpansion256Stdcall () = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_CCons (va_code_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_KeyExpansionRoundUnrolledRecursive256 14) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_KeyExpansion256Stdcall () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_pbool_and (va_codegen_success_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret) (va_pbool_and (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_KeyExpansionRoundUnrolledRecursive256 14) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_KeyExpansion256Stdcall (va_mods:va_mods_t) (input_key_b:buffer128) (output_key_expansion_b:buffer128) : (va_quickCode unit (va_code_KeyExpansion256Stdcall ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s))) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 193 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 194 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 4) Secret input_key_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 195 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret input_key_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 197 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 1) (va_op_reg_opr_reg 3) Secret output_key_expansion_b 0) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 198 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 3) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret output_key_expansion_b 1) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 200 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.expand_key_256_reveal ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 201 column 42 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_KeyExpansionRoundUnrolledRecursive256 key output_key_expansion_b 14) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 202 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES256_helpers_BE.lemma_expand_key_256 key 15) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 203 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" true (fun _ -> va_reveal_eq (`%key_to_round_keys_word) key_to_round_keys_word key_to_round_keys_word) (fun _ -> va_reveal_opaque (`%key_to_round_keys_word) key_to_round_keys_word) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 207 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 208 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 209 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4)) (va_QEmpty (())))))))))))))))) [@"opaque_to_smt"] let va_lemma_KeyExpansion256Stdcall va_b0 va_s0 input_key_b output_key_expansion_b = let (va_mods:va_mods_t) = [va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_KeyExpansion256Stdcall va_mods input_key_b output_key_expansion_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_KeyExpansion256Stdcall ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 186 column 71 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) (va_get_reg 4 va_sM) input_key_b 2 (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 187 column 83 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) (va_get_reg 3 va_sM) output_key_expansion_b 15 (va_get_mem_layout va_sM) Secret)) /\ (let (key:(FStar.Seq.Base.seq Vale.Def.Types_s.nat32)) = Vale.AES.AES256_helpers_BE.make_AES256_key (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 0 (va_get_mem_heaplet 0 va_s0))) (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read input_key_b 1 (va_get_mem_heaplet 0 va_s0))) in label va_range1 "***** POSTCONDITION NOT MET AT line 189 column 70 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (Vale.PPC64LE.Decls.modifies_buffer128 output_key_expansion_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 191 column 133 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (forall (j:nat) . {:pattern(reverse_bytes_quad32 (buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)))}j <= 14 ==> Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read output_key_expansion_b j (va_get_mem_heaplet 1 va_sM)) == FStar.Seq.Base.index #Vale.Def.Types_s.quad32 (Vale.AES.AES_BE_s.key_to_round_keys_word AES_256 key) j))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_KeyExpansion256Stdcall input_key_b output_key_expansion_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_KeyExpansion256Stdcall (va_code_KeyExpansion256Stdcall ()) va_s0 input_key_b output_key_expansion_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_mem_heaplet 1; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound val va_code_AES256EncryptRound : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CNil ()))))) val va_codegen_success_AES256EncryptRound : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound (va_mods:va_mods_t) (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (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 235 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 236 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QEmpty (())))))) val va_lemma_AES256EncryptRound : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n /\ va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound va_b0 va_s0 n init round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound va_mods n init round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 216 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 233 column 51 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v2:quad32) . let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound : n:nat8 -> init:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound n init round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound (va_code_AES256EncryptRound n) va_s0 n init round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound (n:nat8) (init:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound n)) = (va_QProc (va_code_AES256EncryptRound n) ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound n init round_keys keys_buffer) (va_wpProof_AES256EncryptRound n init round_keys keys_buffer)) //-- //-- AES256EncryptBlock [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_AES256EncryptRound 1) (va_CCons (va_code_AES256EncryptRound 2) (va_CCons (va_code_AES256EncryptRound 3) (va_CCons (va_code_AES256EncryptRound 4) (va_CCons (va_code_AES256EncryptRound 5) (va_CCons (va_code_AES256EncryptRound 6) (va_CCons (va_code_AES256EncryptRound 7) (va_CCons (va_code_AES256EncryptRound 8) (va_CCons (va_code_AES256EncryptRound 9) (va_CCons (va_code_AES256EncryptRound 10) (va_CCons (va_code_AES256EncryptRound 11) (va_CCons (va_code_AES256EncryptRound 12) (va_CCons (va_code_AES256EncryptRound 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_CNil ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_AES256EncryptRound 1) (va_pbool_and (va_codegen_success_AES256EncryptRound 2) (va_pbool_and (va_codegen_success_AES256EncryptRound 3) (va_pbool_and (va_codegen_success_AES256EncryptRound 4) (va_pbool_and (va_codegen_success_AES256EncryptRound 5) (va_pbool_and (va_codegen_success_AES256EncryptRound 6) (va_pbool_and (va_codegen_success_AES256EncryptRound 7) (va_pbool_and (va_codegen_success_AES256EncryptRound 8) (va_pbool_and (va_codegen_success_AES256EncryptRound 9) (va_pbool_and (va_codegen_success_AES256EncryptRound 10) (va_pbool_and (va_codegen_success_AES256EncryptRound 11) (va_pbool_and (va_codegen_success_AES256EncryptRound 12) (va_pbool_and (va_codegen_success_AES256EncryptRound 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (va_ttrue ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptBlock (va_mods:va_mods_t) (input:quad32) (key:(seq nat32)) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 262 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let (init:Vale.Def.Types_s.quad32) = Vale.Def.Types_s.quad32_xor input (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 264 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 265 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 266 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 267 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 1 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 268 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 2 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 269 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 3 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 270 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 4 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 271 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 5 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 272 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 6 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 7 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 274 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 8 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 9 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 10 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 277 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 11 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 12 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound 13 init round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 280 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 281 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 2) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 14) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 282 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 286 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (fun (_:unit) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal ()) (va_QEmpty (()))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptBlock va_b0 va_s0 input key round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptBlock va_mods input key round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptBlock ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 260 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.aes_encrypt_word AES_256 key input)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_AES256EncryptBlock input key round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptBlock (va_code_AES256EncryptBlock ()) va_s0 input key round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))); va_lemma_norm_mods ([va_Mod_vec 2; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- AES256EncryptRound_6way val va_code_AES256EncryptRound_6way : n:nat8 -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptRound_6way n = (va_Block (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))) val va_codegen_success_AES256EncryptRound_6way : n:nat8 -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptRound_6way n = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_AES256EncryptRound_6way (va_mods:va_mods_t) (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (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 323 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` n)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 324 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer n) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 325 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 326 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 327 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 329 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 330 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vcipher (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QEmpty (()))))))))))) val va_lemma_AES256EncryptRound_6way : va_b0:va_code -> va_s0:va_state -> n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_AES256EncryptRound_6way n) va_s0 /\ va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n /\ va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0))))))))))) [@"opaque_to_smt"] let va_lemma_AES256EncryptRound_6way va_b0 va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer = let (va_mods:va_mods_t) = [va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok] in let va_qc = va_qcode_AES256EncryptRound_6way va_mods n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_AES256EncryptRound_6way n) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 289 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 316 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 317 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 318 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 319 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 320 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 321 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (1 <= n /\ n < 14 /\ 14 <= FStar.Seq.Base.length #quad32 round_keys) /\ va_get_vec 0 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys (n - 1) /\ va_get_vec 1 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys (n - 1) /\ va_get_vec 2 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys (n - 1) /\ va_get_vec 3 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys (n - 1) /\ va_get_vec 4 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys (n - 1) /\ va_get_vec 5 va_s0 == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys (n - 1) /\ va_get_reg 4 va_s0 == Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint128 keys_buffer (va_get_mem_heaplet 0 va_s0) /\ Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_s0) (va_get_reg 4 va_s0) keys_buffer 15 (va_get_mem_layout va_s0) Secret /\ Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read keys_buffer n (va_get_mem_heaplet 0 va_s0)) == FStar.Seq.Base.index #quad32 round_keys n /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok va_sM /\ va_get_vec 0 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init1 round_keys n /\ va_get_vec 1 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init2 round_keys n /\ va_get_vec 2 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init3 round_keys n /\ va_get_vec 3 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init4 round_keys n /\ va_get_vec 4 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init5 round_keys n /\ va_get_vec 5 va_sM == Vale.AES.AES_BE_s.eval_rounds_def init6 round_keys n ==> va_k va_sM (()))) val va_wpProof_AES256EncryptRound_6way : n:nat8 -> init1:quad32 -> init2:quad32 -> init3:quad32 -> init4:quad32 -> init5:quad32 -> init6:quad32 -> round_keys:(seq quad32) -> keys_buffer:buffer128 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer va_s0 va_k = let (va_sM, va_f0) = va_lemma_AES256EncryptRound_6way (va_code_AES256EncryptRound_6way n) va_s0 n init1 init2 init3 init4 init5 init6 round_keys keys_buffer in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_AES256EncryptRound_6way (n:nat8) (init1:quad32) (init2:quad32) (init3:quad32) (init4:quad32) (init5:quad32) (init6:quad32) (round_keys:(seq quad32)) (keys_buffer:buffer128) : (va_quickCode unit (va_code_AES256EncryptRound_6way n)) = (va_QProc (va_code_AES256EncryptRound_6way n) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_wpProof_AES256EncryptRound_6way n init1 init2 init3 init4 init5 init6 round_keys keys_buffer)) //-- //-- AES256EncryptBlock_6way [@ "opaque_to_smt" va_qattr] let va_code_AES256EncryptBlock_6way () = (va_Block (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CCons (va_code_AES256EncryptRound_6way 1) (va_CCons (va_code_AES256EncryptRound_6way 2) (va_CCons (va_code_AES256EncryptRound_6way 3) (va_CCons (va_code_AES256EncryptRound_6way 4) (va_CCons (va_code_AES256EncryptRound_6way 5) (va_CCons (va_code_AES256EncryptRound_6way 6) (va_CCons (va_code_AES256EncryptRound_6way 7) (va_CCons (va_code_AES256EncryptRound_6way 8) (va_CCons (va_code_AES256EncryptRound_6way 9) (va_CCons (va_code_AES256EncryptRound_6way 10) (va_CCons (va_code_AES256EncryptRound_6way 11) (va_CCons (va_code_AES256EncryptRound_6way 12) (va_CCons (va_code_AES256EncryptRound_6way 13) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_CCons (va_code_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (va_CNil ())))))))))))))))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_AES256EncryptBlock_6way () = (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 1) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 2) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 3) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 4) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 5) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 6) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 7) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 8) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 9) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 10) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 11) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 12) (va_pbool_and (va_codegen_success_AES256EncryptRound_6way 13) (va_pbool_and (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) (16 `op_Multiply` 14)) (va_pbool_and (va_codegen_success_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vcipherlast (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vxor (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 6)) (va_ttrue ())))))))))))))))))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.PPC64LE.State.fsti.checked", "Vale.PPC64LE.QuickCodes.fsti.checked", "Vale.PPC64LE.QuickCode.fst.checked", "Vale.PPC64LE.Memory.fsti.checked", "Vale.PPC64LE.Machine_s.fst.checked", "Vale.PPC64LE.InsVector.fsti.checked", "Vale.PPC64LE.InsMem.fsti.checked", "Vale.PPC64LE.InsBasic.fsti.checked", "Vale.PPC64LE.Decls.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Def.Opaque_s.fsti.checked", "Vale.Arch.Types.fsti.checked", "Vale.AES.AES_common_s.fst.checked", "Vale.AES.AES_BE_s.fst.checked", "Vale.AES.AES256_helpers_BE.fsti.checked", "prims.fst.checked", "FStar.Seq.Base.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.AES.PPC64LE.AES256.fst" }
[ { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES256_helpers_BE", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsVector", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.PPC64LE.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_BE_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Opaque_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.PPC64LE", "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": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.PPC64LE.QuickCode.va_mods_t -> in1: Vale.PPC64LE.Memory.quad32 -> in2: Vale.PPC64LE.Memory.quad32 -> in3: Vale.PPC64LE.Memory.quad32 -> in4: Vale.PPC64LE.Memory.quad32 -> in5: Vale.PPC64LE.Memory.quad32 -> in6: Vale.PPC64LE.Memory.quad32 -> key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 -> round_keys: FStar.Seq.Base.seq Vale.PPC64LE.Memory.quad32 -> keys_buffer: Vale.PPC64LE.Memory.buffer128 -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock_6way ())
Prims.Tot
[ "total" ]
[]
[ "Vale.PPC64LE.QuickCode.va_mods_t", "Vale.PPC64LE.Memory.quad32", "FStar.Seq.Base.seq", "Vale.PPC64LE.Memory.nat32", "Vale.PPC64LE.Memory.buffer128", "Vale.PPC64LE.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.PPC64LE.Decls.va_code", "Vale.PPC64LE.Machine_s.Block", "Vale.PPC64LE.Decls.ins", "Vale.PPC64LE.Decls.ocmp", "Prims.Nil", "Vale.PPC64LE.Machine_s.precode", "Vale.PPC64LE.InsBasic.va_code_LoadImm64", "Vale.PPC64LE.Decls.va_op_reg_opr_reg", "Vale.PPC64LE.InsVector.va_code_Load128_byte16_buffer_index", "Vale.PPC64LE.Decls.va_op_heaplet_mem_heaplet", "Vale.PPC64LE.Decls.va_op_vec_opr_vec", "Vale.Arch.HeapTypes_s.Secret", "Vale.PPC64LE.InsVector.va_code_Vxor", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptRound_6way", "Prims.op_Multiply", "Vale.PPC64LE.InsVector.va_code_Vcipherlast", "Vale.PPC64LE.Decls.va_state", "Vale.PPC64LE.QuickCodes.va_qAssertSquash", "Vale.PPC64LE.QuickCodes.va_range1", "Prims.b2t", "Prims.op_LessThan", "FStar.Seq.Base.length", "Vale.Def.Types_s.quad32", "Prims.nat", "Prims.squash", "Vale.PPC64LE.QuickCodes.va_QSeq", "Vale.PPC64LE.InsBasic.va_quick_LoadImm64", "Vale.PPC64LE.InsVector.va_quick_Load128_byte16_buffer_index", "Vale.PPC64LE.InsVector.va_quick_Vxor", "Vale.AES.PPC64LE.AES256.va_quick_AES256EncryptRound_6way", "Vale.PPC64LE.InsVector.va_quick_Vcipherlast", "Vale.PPC64LE.QuickCodes.va_QBind", "Vale.PPC64LE.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.eq2", "Vale.AES.AES_common_s.algorithm", "Vale.Def.Words_s.nat32", "Vale.AES.AES_BE_s.is_aes_key_word", "Vale.AES.AES_BE_s.aes_encrypt_word", "Vale.AES.AES_BE_s.aes_encrypt_word_def", "Vale.AES.AES_BE_s.aes_encrypt_word_reveal", "Vale.PPC64LE.QuickCodes.va_QEmpty", "Vale.PPC64LE.QuickCodes.quickCodes", "Vale.Def.Types_s.quad32_xor", "FStar.Seq.Base.index", "Vale.PPC64LE.Machine_s.state", "Vale.PPC64LE.QuickCode.va_quickCode", "Vale.AES.PPC64LE.AES256.va_code_AES256EncryptBlock_6way" ]
[]
false
false
false
false
false
let va_qcode_AES256EncryptBlock_6way (va_mods: va_mods_t) (in1 in2 in3 in4 in5 in6: quad32) (key: (seq nat32)) (round_keys: (seq quad32)) (keys_buffer: buffer128) : (va_quickCode unit (va_code_AES256EncryptBlock_6way ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 370 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init1:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in1 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 371 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init2:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in2 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 372 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540)) ) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init3:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in3 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 373 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init4:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in4 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 374 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init5:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in5 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_qAssertSquash va_range1 "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 375 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ((fun a_539 (s_540: (FStar.Seq.Base.seq a_539)) (i_541: Prims.nat) -> let i_515:Prims.nat = i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) Vale.Def.Types_s.quad32 round_keys 0) (fun _ -> let init6:Vale.Def.Types_s.quad32 = Vale.Def.Types_s.quad32_xor in6 (FStar.Seq.Base.index #Vale.Def.Types_s.quad32 round_keys 0) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 377 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 378 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Load128_byte16_buffer_index (va_op_heaplet_mem_heaplet 0) (va_op_vec_opr_vec 6) (va_op_reg_opr_reg 4) (va_op_reg_opr_reg 10) Secret keys_buffer 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 379 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 0) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 380 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 381 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 382 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 3 ) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 383 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 384 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_Vxor (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 6)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 385 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 1 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 386 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 2 init1 init2 init3 init4 init5 init6 round_keys keys_buffer) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 387 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 3 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 388 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 4 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 389 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 5 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 390 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" (va_quick_AES256EncryptRound_6way 6 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 391 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 7 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 392 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 8 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 393 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 9 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 394 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 10 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 395 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 11 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 396 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 12 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 397 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_AES256EncryptRound_6way 13 init1 init2 init3 init4 init5 init6 round_keys keys_buffer ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_LoadImm64 ( va_op_reg_opr_reg 10 ) ( 16 `op_Multiply` 14 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Load128_byte16_buffer_index ( va_op_heaplet_mem_heaplet 0 ) ( va_op_vec_opr_vec 6 ) ( va_op_reg_opr_reg 4 ) ( va_op_reg_opr_reg 10 ) Secret keys_buffer 14 ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 0 ) ( va_op_vec_opr_vec 0 ) ( va_op_vec_opr_vec 6 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 401 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 1 ) ( va_op_vec_opr_vec 1 ) ( va_op_vec_opr_vec 6 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 402 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 2 ) ( va_op_vec_opr_vec 2 ) ( va_op_vec_opr_vec 6 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 403 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 3 ) ( va_op_vec_opr_vec 3 ) ( va_op_vec_opr_vec 6 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 404 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 4 ) ( va_op_vec_opr_vec 4 ) ( va_op_vec_opr_vec 6 ) ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 405 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vcipherlast ( va_op_vec_opr_vec 5 ) ( va_op_vec_opr_vec 5 ) ( va_op_vec_opr_vec 6 ) ) ( va_QBind va_range1 "***** PRECONDITION NOT MET AT line 408 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( va_quick_Vxor ( va_op_vec_opr_vec 6 ) ( va_op_vec_opr_vec 6 ) ( va_op_vec_opr_vec 6 ) ) ( fun ( va_s: va_state ) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 409 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.AES256.vaf *****" ( fun ( _: unit ) -> Vale.AES.AES_BE_s.aes_encrypt_word_reveal () ) ( va_QEmpty ( () ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) )))))))))) ))))))))))
false
Benton2004.RHL.fsti
Benton2004.RHL.gop
val gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to)
val gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to)
let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 37, "start_col": 0, "start_line": 35 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
op: (_: from -> _: from -> Prims.GTot to) -> e1: Benton2004.RHL.gexp from -> e2: Benton2004.RHL.gexp from -> Prims.GTot (Benton2004.RHL.gexp to)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "FStar.DM4F.Heap.IntStoreFixed.heap" ]
[]
false
false
false
false
false
let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) =
let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g
false
Benton2004.RHL.fsti
Benton2004.RHL.gconst
val gconst (#t: Type0) (n: t) : gexp t
val gconst (#t: Type0) (n: t) : gexp t
let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 25, "start_col": 0, "start_line": 23 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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: t -> Benton2004.RHL.gexp t
Prims.Tot
[ "total" ]
[]
[ "FStar.DM4F.Heap.IntStoreFixed.heap", "Benton2004.RHL.gexp" ]
[]
false
false
false
true
false
let gconst (#t: Type0) (n: t) : gexp t =
let g _ _ : GTot t = n in g
false
Benton2004.RHL.fsti
Benton2004.RHL.gnot
val gnot (e: gexp bool) : GTot (gexp bool)
val gnot (e: gexp bool) : GTot (gexp bool)
let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 41, "start_col": 0, "start_line": 39 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
e: Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "FStar.DM4F.Heap.IntStoreFixed.heap", "Prims.op_Negation" ]
[]
false
false
false
false
false
let gnot (e: gexp bool) : GTot (gexp bool) =
let g s1 s2 = not (e s1 s2) in g
false
Benton2004.RHL.fsti
Benton2004.RHL.interp
val interp (ge: gexp bool) : GTot sttype
val interp (ge: gexp bool) : GTot sttype
let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 76, "start_col": 0, "start_line": 74 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
ge: Benton2004.RHL.gexp Prims.bool -> Prims.GTot Benton2004.sttype
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "FStar.DM4F.Heap.IntStoreFixed.heap", "Prims.eq2", "Benton2004.sttype" ]
[]
false
false
false
false
false
let interp (ge: gexp bool) : GTot sttype =
let g s1 s2 : GTot Type0 = ge s1 s2 == true in g
false
Benton2004.RHL.fsti
Benton2004.RHL.gvar
val gvar (x: var) (side: pos) : GTot (gexp int)
val gvar (x: var) (side: pos) : GTot (gexp int)
let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 33, "start_col": 0, "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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
x: Benton2004.var -> side: Benton2004.RHL.pos -> Prims.GTot (Benton2004.RHL.gexp Prims.int)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.var", "Benton2004.RHL.pos", "FStar.DM4F.Heap.IntStoreFixed.heap", "Prims.int", "FStar.DM4F.Heap.IntStoreFixed.sel", "Benton2004.RHL.gexp" ]
[]
false
false
false
false
false
let gvar (x: var) (side: pos) : GTot (gexp int) =
let g s1 s2 : GTot int = sel (match side with | Left -> s1 | Right -> s2) x in g
false
Benton2004.RHL.fsti
Benton2004.RHL.gand
val gand (b1 b2: gexp bool) : GTot (gexp bool)
val gand (b1 b2: gexp bool) : GTot (gexp bool)
let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 21, "end_line": 138, "start_col": 0, "start_line": 137 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
b1: Benton2004.RHL.gexp Prims.bool -> b2: Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "Benton2004.RHL.gop", "Prims.op_AmpAmp" ]
[]
false
false
false
false
false
let gand (b1 b2: gexp bool) : GTot (gexp bool) =
gop op_AmpAmp b1 b2
false
Benton2004.RHL.fsti
Benton2004.RHL.gor
val gor (b1 b2: gexp bool) : GTot (gexp bool)
val gor (b1 b2: gexp bool) : GTot (gexp bool)
let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 21, "end_line": 149, "start_col": 0, "start_line": 148 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
b1: Benton2004.RHL.gexp Prims.bool -> b2: Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "Benton2004.RHL.gop", "Prims.op_BarBar" ]
[]
false
false
false
false
false
let gor (b1 b2: gexp bool) : GTot (gexp bool) =
gop op_BarBar b1 b2
false
Benton2004.RHL.fsti
Benton2004.RHL.gsubst
val gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t
val gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t
let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 52, "start_col": 0, "start_line": 45 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
ge: Benton2004.RHL.gexp t -> x: Benton2004.var -> side: Benton2004.RHL.pos -> ge': Benton2004.RHL.gexp Prims.int -> Benton2004.RHL.gexp t
Prims.Tot
[ "total" ]
[]
[ "Benton2004.RHL.gexp", "Benton2004.var", "Benton2004.RHL.pos", "Prims.int", "FStar.DM4F.Heap.IntStoreFixed.heap", "FStar.DM4F.Heap.IntStoreFixed.upd" ]
[]
false
false
false
true
false
let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t =
let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g
false
Benton2004.RHL.fsti
Benton2004.RHL.geq
val geq (#t: eqtype) (e1 e2: gexp t) : GTot (gexp bool)
val geq (#t: eqtype) (e1 e2: gexp t) : GTot (gexp bool)
let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 23, "end_line": 167, "start_col": 0, "start_line": 163 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
e1: Benton2004.RHL.gexp t -> e2: Benton2004.RHL.gexp t -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Prims.eqtype", "Benton2004.RHL.gexp", "Benton2004.RHL.gop", "Prims.bool", "Prims.op_Equality" ]
[]
false
false
false
false
false
let geq (#t: eqtype) (e1 e2: gexp t) : GTot (gexp bool) =
gop op_Equality e1 e2
false
Benton2004.RHL.fsti
Benton2004.RHL.r_if_precond_true
val r_if_precond_true (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
val r_if_precond_true (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 59, "end_line": 194, "start_col": 0, "start_line": 189 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
b: Benton2004.exp Prims.bool -> b': Benton2004.exp Prims.bool -> c: Benton2004.computation -> c': Benton2004.computation -> d: Benton2004.computation -> d': Benton2004.computation -> p: Benton2004.RHL.gexp Prims.bool -> p': Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.exp", "Prims.bool", "Benton2004.computation", "Benton2004.RHL.gexp", "Benton2004.RHL.gand", "Benton2004.RHL.exp_to_gexp", "Benton2004.RHL.Left", "Benton2004.RHL.Right" ]
[]
false
false
false
false
false
let r_if_precond_true (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool) =
gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))
false
Benton2004.RHL.fsti
Benton2004.RHL.exp_to_gexp
val exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t)
val exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t)
let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 111, "start_col": 0, "start_line": 103 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
e: Benton2004.exp t -> side: Benton2004.RHL.pos -> Prims.GTot (Benton2004.RHL.gexp t)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.exp", "Benton2004.RHL.pos", "FStar.DM4F.Heap.IntStoreFixed.heap", "FStar.Pervasives.Native.fst", "Benton2004.reify_exp", "Benton2004.RHL.gexp" ]
[]
false
false
false
false
false
let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) =
let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g
false
Benton2004.RHL.fsti
Benton2004.RHL.r_if_precond_false
val r_if_precond_false (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
val r_if_precond_false (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right)))
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 65, "end_line": 213, "start_col": 0, "start_line": 208 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true ))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
b: Benton2004.exp Prims.bool -> b': Benton2004.exp Prims.bool -> c: Benton2004.computation -> c': Benton2004.computation -> d: Benton2004.computation -> d': Benton2004.computation -> p: Benton2004.RHL.gexp Prims.bool -> p': Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.exp", "Prims.bool", "Benton2004.computation", "Benton2004.RHL.gexp", "Benton2004.RHL.gand", "Benton2004.RHL.gnot", "Benton2004.RHL.gor", "Benton2004.RHL.exp_to_gexp", "Benton2004.RHL.Left", "Benton2004.RHL.Right" ]
[]
false
false
false
false
false
let r_if_precond_false (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool) =
gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right)))
false
Benton2004.RHL.fsti
Benton2004.RHL.r_if_precond
val r_if_precond (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
val r_if_precond (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool)
let r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 58, "end_line": 231, "start_col": 0, "start_line": 226 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true )) let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))) val holds_r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_false b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ ( ~ (fst (reify_exp b s1) == true \/ fst (reify_exp b' s2) == true)) ))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
b: Benton2004.exp Prims.bool -> b': Benton2004.exp Prims.bool -> c: Benton2004.computation -> c': Benton2004.computation -> d: Benton2004.computation -> d': Benton2004.computation -> p: Benton2004.RHL.gexp Prims.bool -> p': Benton2004.RHL.gexp Prims.bool -> Prims.GTot (Benton2004.RHL.gexp Prims.bool)
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.exp", "Prims.bool", "Benton2004.computation", "Benton2004.RHL.gexp", "Benton2004.RHL.gand", "Benton2004.RHL.geq", "Benton2004.RHL.exp_to_gexp", "Benton2004.RHL.Left", "Benton2004.RHL.Right" ]
[]
false
false
false
false
false
let r_if_precond (b b': exp bool) (c c' d d': computation) (p p': gexp bool) : GTot (gexp bool) =
gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))
false
Benton2004.RHL.fsti
Benton2004.RHL.flip
val flip (phi: gexp bool) : Tot (gexp bool)
val flip (phi: gexp bool) : Tot (gexp bool)
let flip (phi: gexp bool) : Tot (gexp bool) = let g s1 s2 = phi s2 s1 in g
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 3, "end_line": 339, "start_col": 0, "start_line": 337 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true )) let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))) val holds_r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_false b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ ( ~ (fst (reify_exp b s1) == true \/ fst (reify_exp b' s2) == true)) )) let r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == fst (reify_exp b' s2) )) val r_if (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (requires ( exec_equiv (r_if_precond_true b b' c c' d d' p p') p' c c' /\ exec_equiv (r_if_precond_false b b' c c' d d' p p') p' d d' )) (ensures ( exec_equiv (r_if_precond b b' c c' d d' p p') p' (ifthenelse b c d) (ifthenelse b' c' d') )) val r_seq (p0 p1 p2 : gexp bool) (c01 c01' c12 c12' : computation) : Lemma (requires ( exec_equiv p0 p1 c01 c01' /\ exec_equiv p1 p2 c12 c12' )) (ensures ( exec_equiv p0 p2 (seq c01 c12) (seq c01' c12') )) [SMTPatOr [ [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p0 p1 c01 c01')]; [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p1 p2 c12 c12')]; [SMTPat (exec_equiv p0 p1 c01 c01'); SMTPat (exec_equiv p1 p2 c12 c12')]; ]] val r_ass (x y: var) (e e' : exp int) (p: gexp bool) : Lemma (exec_equiv (gsubst (gsubst p x Left (exp_to_gexp e Left)) y Right (exp_to_gexp e' Right)) p (assign x e) (assign y e') ) let included (p1 p2: gexp bool) : GTot Type0 = Benton2004.included (interp p1) (interp p2) val included_alt (p1 p2 : gexp bool) : Lemma (included p1 p2 <==> (forall s1 s2 . p1 s1 s2 == true ==> p2 s1 s2 == true)) [SMTPat (included p1 p2)] val r_sub (p1 p2 p1' p2' : gexp bool) (f f' : computation) : Lemma (requires ( exec_equiv p1 p2 f f' /\ included p1' p1 /\ included p2 p2' )) (ensures (exec_equiv p1' p2' f f')) [SMTPat (exec_equiv p1' p2' f f'); SMTPat (exec_equiv p1 p2 f f')] val r_while_terminates' (b b' : exp bool) (c c' : computation) (phi phi_c phi_c': gexp bool) (s0 s0' : heap) (fuel: nat) : Lemma (requires ( included phi (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) /\ included (gand phi (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) phi_c /\ included phi_c' phi /\ exec_equiv phi_c phi_c' c c' /\ holds (interp phi) s0 s0' /\ fst (reify_computation (while b c) fuel s0) == true )) (ensures ( terminates_on (reify_computation (while b' c')) s0' )) (decreases fuel)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
phi: Benton2004.RHL.gexp Prims.bool -> Benton2004.RHL.gexp Prims.bool
Prims.Tot
[ "total" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "FStar.DM4F.Heap.IntStoreFixed.heap" ]
[]
false
false
false
true
false
let flip (phi: gexp bool) : Tot (gexp bool) =
let g s1 s2 = phi s2 s1 in g
false
Benton2004.RHL.fsti
Benton2004.RHL.included
val included (p1 p2: gexp bool) : GTot Type0
val included (p1 p2: gexp bool) : GTot Type0
let included (p1 p2: gexp bool) : GTot Type0 = Benton2004.included (interp p1) (interp p2)
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 45, "end_line": 299, "start_col": 0, "start_line": 298 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true )) let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))) val holds_r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_false b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ ( ~ (fst (reify_exp b s1) == true \/ fst (reify_exp b' s2) == true)) )) let r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == fst (reify_exp b' s2) )) val r_if (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (requires ( exec_equiv (r_if_precond_true b b' c c' d d' p p') p' c c' /\ exec_equiv (r_if_precond_false b b' c c' d d' p p') p' d d' )) (ensures ( exec_equiv (r_if_precond b b' c c' d d' p p') p' (ifthenelse b c d) (ifthenelse b' c' d') )) val r_seq (p0 p1 p2 : gexp bool) (c01 c01' c12 c12' : computation) : Lemma (requires ( exec_equiv p0 p1 c01 c01' /\ exec_equiv p1 p2 c12 c12' )) (ensures ( exec_equiv p0 p2 (seq c01 c12) (seq c01' c12') )) [SMTPatOr [ [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p0 p1 c01 c01')]; [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p1 p2 c12 c12')]; [SMTPat (exec_equiv p0 p1 c01 c01'); SMTPat (exec_equiv p1 p2 c12 c12')]; ]] val r_ass (x y: var) (e e' : exp int) (p: gexp bool) : Lemma (exec_equiv (gsubst (gsubst p x Left (exp_to_gexp e Left)) y Right (exp_to_gexp e' Right)) p (assign x e) (assign y e') )
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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
p1: Benton2004.RHL.gexp Prims.bool -> p2: Benton2004.RHL.gexp Prims.bool -> Prims.GTot Type0
Prims.GTot
[ "sometrivial" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "Benton2004.included", "FStar.DM4F.Heap.IntStoreFixed.heap", "Benton2004.RHL.interp" ]
[]
false
false
false
false
true
let included (p1 p2: gexp bool) : GTot Type0 =
Benton2004.included (interp p1) (interp p2)
false
Benton2004.RHL.fsti
Benton2004.RHL.interpolable
val interpolable : p: Benton2004.RHL.gexp Prims.bool -> Type0
let interpolable (p: gexp bool) = Benton2004.interpolable (interp p)
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 68, "end_line": 435, "start_col": 0, "start_line": 435 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true )) let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))) val holds_r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_false b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ ( ~ (fst (reify_exp b s1) == true \/ fst (reify_exp b' s2) == true)) )) let r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == fst (reify_exp b' s2) )) val r_if (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (requires ( exec_equiv (r_if_precond_true b b' c c' d d' p p') p' c c' /\ exec_equiv (r_if_precond_false b b' c c' d d' p p') p' d d' )) (ensures ( exec_equiv (r_if_precond b b' c c' d d' p p') p' (ifthenelse b c d) (ifthenelse b' c' d') )) val r_seq (p0 p1 p2 : gexp bool) (c01 c01' c12 c12' : computation) : Lemma (requires ( exec_equiv p0 p1 c01 c01' /\ exec_equiv p1 p2 c12 c12' )) (ensures ( exec_equiv p0 p2 (seq c01 c12) (seq c01' c12') )) [SMTPatOr [ [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p0 p1 c01 c01')]; [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p1 p2 c12 c12')]; [SMTPat (exec_equiv p0 p1 c01 c01'); SMTPat (exec_equiv p1 p2 c12 c12')]; ]] val r_ass (x y: var) (e e' : exp int) (p: gexp bool) : Lemma (exec_equiv (gsubst (gsubst p x Left (exp_to_gexp e Left)) y Right (exp_to_gexp e' Right)) p (assign x e) (assign y e') ) let included (p1 p2: gexp bool) : GTot Type0 = Benton2004.included (interp p1) (interp p2) val included_alt (p1 p2 : gexp bool) : Lemma (included p1 p2 <==> (forall s1 s2 . p1 s1 s2 == true ==> p2 s1 s2 == true)) [SMTPat (included p1 p2)] val r_sub (p1 p2 p1' p2' : gexp bool) (f f' : computation) : Lemma (requires ( exec_equiv p1 p2 f f' /\ included p1' p1 /\ included p2 p2' )) (ensures (exec_equiv p1' p2' f f')) [SMTPat (exec_equiv p1' p2' f f'); SMTPat (exec_equiv p1 p2 f f')] val r_while_terminates' (b b' : exp bool) (c c' : computation) (phi phi_c phi_c': gexp bool) (s0 s0' : heap) (fuel: nat) : Lemma (requires ( included phi (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) /\ included (gand phi (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) phi_c /\ included phi_c' phi /\ exec_equiv phi_c phi_c' c c' /\ holds (interp phi) s0 s0' /\ fst (reify_computation (while b c) fuel s0) == true )) (ensures ( terminates_on (reify_computation (while b' c')) s0' )) (decreases fuel) let flip (phi: gexp bool) : Tot (gexp bool) = let g s1 s2 = phi s2 s1 in g val holds_interp_flip (phi: gexp bool) : Lemma (forall s1 s2 . holds (interp (flip phi)) s1 s2 <==> holds (Benton2004.flip (interp phi)) s1 s2) [SMTPat (holds (interp (flip phi)))] val exec_equiv_flip (p p': gexp bool) (f f' : computation) : Lemma (exec_equiv (flip p) (flip p') f f' <==> exec_equiv p p' f' f) [SMTPat (exec_equiv (flip p) (flip p') f f')] val r_while_terminates (b b' : exp bool) (c c' : computation) (p: gexp bool) (s0 s0' : heap) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' /\ holds (interp (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)))) s0 s0' )) (ensures ( terminates_on (reify_computation (while b c)) s0 <==> terminates_on (reify_computation (while b' c')) s0' )) val r_while_correct (b b' : exp bool) (c c' : computation) (p: gexp bool) (s0 s0' : heap) (fuel: nat) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' /\ holds (interp (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)))) s0 s0' /\ fst (reify_computation (while b c) fuel s0) == true /\ fst (reify_computation (while b' c') fuel s0') == true )) (ensures ( holds (interp (gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))))) (snd (reify_computation (while b c) fuel s0)) (snd (reify_computation (while b' c') fuel s0')) )) (decreases fuel) val r_while (b b' : exp bool) (c c' : computation) (p: gexp bool) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' )) (ensures ( exec_equiv (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right)))) (while b c) (while b' c') )) let is_per (p: gexp bool) = Benton2004.is_per (interp p) (* Aparte: 4.4 How to prove is_per *) val is_per_geq_exp_to_gexp (#t: eqtype) (e: exp t) : Lemma (is_per (geq (exp_to_gexp e Left) (exp_to_gexp e Right))) val is_per_gand_exp_to_gexp (b: exp bool) : Lemma (is_per (gand (exp_to_gexp b Left) (exp_to_gexp b Right))) val is_per_gand (e1 e2 : gexp bool) : Lemma (requires (is_per e1 /\ is_per e2)) (ensures (is_per (gand e1 e2))) (* FIXME: holds but not replayable let is_per_gor (e1 e2 : gexp bool) : Lemma (requires (is_per e1 /\ is_per e2 /\ (forall s1 s2 . ~ (holds (interp e1) s1 s2 /\ holds (interp e2) s1 s2)))) (ensures (is_per (gor e1 e2))) = assert (forall s1 s2 . holds (interp (gor e1 e2)) s1 s2 <==> holds (interp e1) s1 s2 \/ holds (interp e2) s1 s2) *) val r_sym (p p': gexp bool) (f f' : computation) : Lemma (requires (is_per p /\ is_per p')) (ensures (exec_equiv p p' f f' <==> exec_equiv p p' f' f)) [SMTPat (exec_equiv p p' f f'); SMTPat (is_per p); SMTPat (is_per p')]
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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: Benton2004.RHL.gexp Prims.bool -> Type0
Prims.Tot
[ "total" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "Benton2004.interpolable", "FStar.DM4F.Heap.IntStoreFixed.heap", "Benton2004.RHL.interp" ]
[]
false
false
false
true
true
let interpolable (p: gexp bool) =
Benton2004.interpolable (interp p)
false
Benton2004.RHL.fsti
Benton2004.RHL.is_per
val is_per : p: Benton2004.RHL.gexp Prims.bool -> Type0
let is_per (p: gexp bool) = Benton2004.is_per (interp p)
{ "file_name": "examples/rel/Benton2004.RHL.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 56, "end_line": 397, "start_col": 0, "start_line": 397 }
(* 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 Benton2004.RHL include Benton2004 (* Relational Hoare Logic (Section 4) *) type gexp (t: Type0) = heap -> heap -> GTot t let gconst (#t: Type0) (n: t) : gexp t = let g _ _ : GTot t = n in g type pos = | Left | Right let gvar (x: var) (side: pos) : GTot (gexp int) = let g s1 s2 : GTot int = sel (match side with Left -> s1 | Right -> s2) x in g let gop (#from #to: Type0) (op: (from -> from -> GTot to)) (e1 e2: gexp from) : GTot (gexp to) = let g s1 s2 : GTot to = op (e1 s1 s2) (e2 s1 s2) in g let gnot (e: gexp bool) : GTot (gexp bool) = let g s1 s2 = not (e s1 s2) in g (* Substitution: Lemma 3 al. 1, 2 *) let gsubst (#t: Type0) (ge: gexp t) (x: var) (side: pos) (ge': gexp int) : gexp t = let g s1 s2 : GTot t = let v' = ge' s1 s2 in match side with | Left -> ge (upd s1 x v') s2 | Right -> ge s1 (upd s2 x v') in g val gsubst_gconst (#t: Type0) (n: t) (x: var) (side: pos) (ge' : gexp int): Lemma (forall h1 h2. (gsubst (gconst n) x side ge') h1 h2 == (gconst n) h1 h2) [SMTPat (gsubst (gconst n) x side ge')] val gsubst_gvar_same (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gvar x side) x side ge') h1 h2 == ge' h1 h2) [SMTPat (gsubst (gvar x side) x side ge')] val gsubst_gvar_other (x x': var) (side side': pos) (ge': gexp int) : Lemma (requires (x <> x' \/ side <> side')) (ensures (forall h1 h2. (gsubst (gvar x side) x' side' ge') h1 h2 == (gvar x side) h1 h2)) [SMTPat (gsubst (gvar x side) x' side' ge')] val gsubst_gop (#from #to: Type0) (op: (from -> from -> GTot to)) (ge1 ge2: gexp from) (x: var) (side: pos) (ge': gexp int) : Lemma (forall h1 h2. (gsubst (gop op ge1 ge2) x side ge') h1 h2 == (gop op (gsubst ge1 x side ge') (gsubst ge2 x side ge')) h1 h2) [SMTPat (gsubst (gop op ge1 ge2) x side ge')] (* 4.1.3 Inference rules *) let interp (ge: gexp bool) : GTot sttype = let g s1 s2 : GTot Type0 = ge s1 s2 == true in g val holds_interp (ge: gexp bool) (s1 s2: heap) : Lemma (holds (interp ge) s1 s2 <==> ge s1 s2 == true) [SMTPat (holds (interp ge) s1 s2)] val exec_equiv (p p' : gexp bool) (f f' : computation) : GTot Type0 val exec_equiv_elim (p p' : gexp bool) (f f' : computation) : Lemma (requires (exec_equiv p p' f f')) (ensures (Benton2004.exec_equiv (interp p) (interp p') f f')) val r_skip (p: gexp bool) : Lemma (exec_equiv p p skip skip) [SMTPat (exec_equiv p p skip skip)] let exp_to_gexp (#t: Type0) (e: exp t) (side: pos) : GTot (gexp t) = let g s1 s2 : GTot t = fst (reify_exp e (match side with | Left -> s1 | Right -> s2)) in g val exp_to_gexp_const (#t: Type0) (c: t) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (const c) side) h1 h2 == (gconst c) h1 h2) [SMTPat (exp_to_gexp (const c) side)] val exp_to_gexp_evar (x: var) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (evar x) side) h1 h2 == (gvar x side) h1 h2) [SMTPat (exp_to_gexp (evar x) side)] val exp_to_gexp_eop (#from #to: Type0) (op: (from -> from -> Tot to)) (e1 e2: exp from) (side: pos) : Lemma (forall h1 h2. (exp_to_gexp (eop op e1 e2) side) h1 h2 == (gop op (exp_to_gexp e1 side) (exp_to_gexp e2 side)) h1 h2) [SMTPat (exp_to_gexp (eop op e1 e2) side)] let gand (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_AmpAmp b1 b2 val holds_gand (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gand b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 /\ holds (interp b2) s1 s2) [SMTPat (holds (interp (gand b1 b2)))] val gsubst_gand (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gand b1 b2) x side e) h1 h2 == (gand (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gand b1 b2) x side e)] let gor (b1 b2 : gexp bool) : GTot (gexp bool) = gop op_BarBar b1 b2 val holds_gor (b1 b2 : gexp bool) : Lemma (forall s1 s2 . holds (interp (gor b1 b2)) s1 s2 <==> holds (interp b1) s1 s2 \/ holds (interp b2) s1 s2) [SMTPat (holds (interp (gor b1 b2)))] val gsubst_gor (b1 b2: gexp bool) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (gor b1 b2) x side e) h1 h2 == (gor (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (gor b1 b2) x side e)] val holds_gnot (b: gexp bool) : Lemma (forall s1 s2 . holds (interp (gnot b)) s1 s2 <==> ~ (holds (interp b) s1 s2)) [SMTPat (holds (interp (gnot b)))] let geq (#t: eqtype) (e1 e2 : gexp t) : GTot (gexp bool) = gop op_Equality e1 e2 val holds_geq (#t: eqtype) (e1 e2 : gexp t) : Lemma (forall s1 s2 . holds (interp (geq e1 e2)) s1 s2 <==> e1 s1 s2 == e2 s1 s2) [SMTPat (holds (interp (geq e1 e2)))] val gsubst_geq (#t: eqtype) (b1 b2: gexp t) (x:_) (side:_) (e:_) : Lemma (forall h1 h2. (gsubst (geq b1 b2) x side e) h1 h2 == (geq (gsubst b1 x side e) (gsubst b2 x side e)) h1 h2) [SMTPat (gsubst (geq b1 b2) x side e)] val holds_exp_to_gexp_left (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Left)) s1 s2 <==> fst (reify_exp e s1) == true) [SMTPat (holds (interp (exp_to_gexp e Left)))] val holds_exp_to_gexp_right (e: exp bool) : Lemma (forall s1 s2 . holds (interp (exp_to_gexp e Right)) s1 s2 <==> fst (reify_exp e s2) == true) [SMTPat (holds (interp (exp_to_gexp e Right)))] let r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond_true (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_true b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == true /\ fst (reify_exp b' s2) == true )) let r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))) val holds_r_if_precond_false (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond_false b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ ( ~ (fst (reify_exp b s1) == true \/ fst (reify_exp b' s2) == true)) )) let r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : GTot (gexp bool) = gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) val holds_r_if_precond (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (forall s1 s2 . holds (interp (r_if_precond b b' c c' d d' p p')) s1 s2 <==> ( holds (interp p) s1 s2 /\ fst (reify_exp b s1) == fst (reify_exp b' s2) )) val r_if (b b': exp bool) (c c' d d' : computation) (p p' : gexp bool) : Lemma (requires ( exec_equiv (r_if_precond_true b b' c c' d d' p p') p' c c' /\ exec_equiv (r_if_precond_false b b' c c' d d' p p') p' d d' )) (ensures ( exec_equiv (r_if_precond b b' c c' d d' p p') p' (ifthenelse b c d) (ifthenelse b' c' d') )) val r_seq (p0 p1 p2 : gexp bool) (c01 c01' c12 c12' : computation) : Lemma (requires ( exec_equiv p0 p1 c01 c01' /\ exec_equiv p1 p2 c12 c12' )) (ensures ( exec_equiv p0 p2 (seq c01 c12) (seq c01' c12') )) [SMTPatOr [ [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p0 p1 c01 c01')]; [SMTPat (exec_equiv p0 p2 (seq c01 c12) (seq c01' c12')); SMTPat (exec_equiv p1 p2 c12 c12')]; [SMTPat (exec_equiv p0 p1 c01 c01'); SMTPat (exec_equiv p1 p2 c12 c12')]; ]] val r_ass (x y: var) (e e' : exp int) (p: gexp bool) : Lemma (exec_equiv (gsubst (gsubst p x Left (exp_to_gexp e Left)) y Right (exp_to_gexp e' Right)) p (assign x e) (assign y e') ) let included (p1 p2: gexp bool) : GTot Type0 = Benton2004.included (interp p1) (interp p2) val included_alt (p1 p2 : gexp bool) : Lemma (included p1 p2 <==> (forall s1 s2 . p1 s1 s2 == true ==> p2 s1 s2 == true)) [SMTPat (included p1 p2)] val r_sub (p1 p2 p1' p2' : gexp bool) (f f' : computation) : Lemma (requires ( exec_equiv p1 p2 f f' /\ included p1' p1 /\ included p2 p2' )) (ensures (exec_equiv p1' p2' f f')) [SMTPat (exec_equiv p1' p2' f f'); SMTPat (exec_equiv p1 p2 f f')] val r_while_terminates' (b b' : exp bool) (c c' : computation) (phi phi_c phi_c': gexp bool) (s0 s0' : heap) (fuel: nat) : Lemma (requires ( included phi (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)) /\ included (gand phi (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) phi_c /\ included phi_c' phi /\ exec_equiv phi_c phi_c' c c' /\ holds (interp phi) s0 s0' /\ fst (reify_computation (while b c) fuel s0) == true )) (ensures ( terminates_on (reify_computation (while b' c')) s0' )) (decreases fuel) let flip (phi: gexp bool) : Tot (gexp bool) = let g s1 s2 = phi s2 s1 in g val holds_interp_flip (phi: gexp bool) : Lemma (forall s1 s2 . holds (interp (flip phi)) s1 s2 <==> holds (Benton2004.flip (interp phi)) s1 s2) [SMTPat (holds (interp (flip phi)))] val exec_equiv_flip (p p': gexp bool) (f f' : computation) : Lemma (exec_equiv (flip p) (flip p') f f' <==> exec_equiv p p' f' f) [SMTPat (exec_equiv (flip p) (flip p') f f')] val r_while_terminates (b b' : exp bool) (c c' : computation) (p: gexp bool) (s0 s0' : heap) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' /\ holds (interp (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)))) s0 s0' )) (ensures ( terminates_on (reify_computation (while b c)) s0 <==> terminates_on (reify_computation (while b' c')) s0' )) val r_while_correct (b b' : exp bool) (c c' : computation) (p: gexp bool) (s0 s0' : heap) (fuel: nat) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' /\ holds (interp (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right)))) s0 s0' /\ fst (reify_computation (while b c) fuel s0) == true /\ fst (reify_computation (while b' c') fuel s0') == true )) (ensures ( holds (interp (gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right))))) (snd (reify_computation (while b c) fuel s0)) (snd (reify_computation (while b' c') fuel s0')) )) (decreases fuel) val r_while (b b' : exp bool) (c c' : computation) (p: gexp bool) : Lemma (requires ( exec_equiv (gand p (gand (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) c c' )) (ensures ( exec_equiv (gand p (geq (exp_to_gexp b Left) (exp_to_gexp b' Right))) (gand p (gnot (gor (exp_to_gexp b Left) (exp_to_gexp b' Right)))) (while b c) (while b' c') ))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "Benton2004.fst.checked" ], "interface_file": false, "source_file": "Benton2004.RHL.fsti" }
[ { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "short_module": null }, { "abbrev": false, "full_module": "Benton2004", "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: Benton2004.RHL.gexp Prims.bool -> Type0
Prims.Tot
[ "total" ]
[]
[ "Benton2004.RHL.gexp", "Prims.bool", "Benton2004.is_per", "FStar.DM4F.Heap.IntStoreFixed.heap", "Benton2004.RHL.interp" ]
[]
false
false
false
true
true
let is_per (p: gexp bool) =
Benton2004.is_per (interp p)
false