val va_qcode_Keyhash_init
      (va_mods: va_mods_t)
      (win: bool)
      (alg: algorithm)
      (key: (seq nat32))
      (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init win alg))
let va_qcode_Keyhash_init (va_mods:va_mods_t) (win:bool) (alg:algorithm) (key:(seq nat32))
  (roundkeys_b:buffer128) (hkeys_b:buffer128) : (va_quickCode unit (va_code_Keyhash_init win alg)) =
  (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
    (round_ptr:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
    (fun _ -> va_get_reg64 rRdi va_s) in let (hkey_ptr:(va_int_range 0 18446744073709551615)) =
    va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 252 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_CreateHeaplets ([declare_buffer128 roundkeys_b 0 Secret Immutable; declare_buffer128
    hkeys_b 1 Secret Mutable])) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 256 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_InitPshufbMask (va_op_xmm_xmm 4) (va_op_reg_opr64_reg64 rR8)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 257 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ZeroXmm (va_op_xmm_xmm 0)) (fun (va_s:va_state) _ -> va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 258 column 15 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 260 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRdx)
    (va_op_xmm_xmm 0) 80 Secret hkeys_b 5) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 261 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))
    (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 265 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRsi)
    (va_op_xmm_xmm 0) 80 Secret hkeys_b 5) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 266 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRdi)) (va_QEmpty (())))))) (fun
    (va_s:va_state) va_g -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 268 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_AESEncryptBlock alg (va_get_xmm 0 va_s) key (Vale.X64.Decls.buffer128_as_seq
    (va_get_mem_heaplet 0 va_s) roundkeys_b) roundkeys_b) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 269 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Pshufb (va_op_xmm_xmm 0) (va_op_xmm_xmm 4)) (fun (va_s:va_state) _ -> va_QBind
    va_range1
    "***** PRECONDITION NOT MET AT line 270 column 15 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 272 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRdx)) (va_QEmpty (()))))
    (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 276 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRsi)) (va_QEmpty (()))))) (fun
    (va_s:va_state) va_g -> va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 278 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 0) 32 Secret hkeys_b 2) (fun (va_s:va_state) _ -> va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 280 column 17 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128_powers (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 0 va_s)) hkeys_b) (fun
    (va_s:va_state) _ -> va_qAssertSquash va_range1
    "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 282 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    ((fun (alg_10584:Vale.AES.AES_common_s.algorithm) (key_10585:(FStar.Seq.Base.seq
    Vale.Def.Types_s.nat32)) (input_LE_10586:Vale.Def.Types_s.quad32) ->
    Vale.AES.AES_s.is_aes_key_LE alg_10584 key_10585) alg key (Vale.Def.Words_s.Mkfour
    #Vale.Def.Types_s.nat32 0 0 0 0)) (fun _ -> let (va_arg27:Vale.Def.Types_s.quad32) =
    Vale.Def.Types_s.reverse_bytes_quad32 (Vale.AES.AES_s.aes_encrypt_LE alg key
    (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0)) in let (va_arg26:(FStar.Seq.Base.seq
    Vale.Def.Types_s.quad32)) = Vale.X64.Decls.s128 (va_get_mem_heaplet 1 va_s) hkeys_b in va_qPURE
    va_range1
    "***** PRECONDITION NOT MET AT line 282 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_hkeys_reqs_pub_priv va_arg26 va_arg27) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 284 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))
val va_qcode_Keyhash_init
      (va_mods: va_mods_t)
      (win: bool)
      (alg: algorithm)
      (key: (seq nat32))
      (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init win alg))
let va_qcode_Keyhash_init
      (va_mods: va_mods_t)
      (win: bool)
      (alg: algorithm)
      (key: (seq nat32))
      (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init win alg)) =
(qblock va_mods
    (fun (va_s: va_state) ->
        let va_old_s:va_state = va_s in
        let round_ptr:(va_int_range 0 18446744073709551615) =
          va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s)
        in
        let hkey_ptr:(va_int_range 0 18446744073709551615) =
          va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s)
        in
        va_QSeq va_range1
          "***** PRECONDITION NOT MET AT line 252 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
          (va_quick_CreateHeaplets ([
                  declare_buffer128 roundkeys_b 0 Secret Immutable;
                  declare_buffer128 hkeys_b 1 Secret Mutable
                ]))
          (va_QSeq va_range1
              "***** PRECONDITION NOT MET AT line 256 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
              (va_quick_InitPshufbMask (va_op_xmm_xmm 4) (va_op_reg_opr64_reg64 rR8))
              (va_QBind va_range1
                  "***** PRECONDITION NOT MET AT line 257 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                  (va_quick_ZeroXmm (va_op_xmm_xmm 0))
                  (fun (va_s: va_state) _ ->
                      va_QBind va_range1
                        "***** PRECONDITION NOT MET AT line 258 column 15 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                        (va_qInlineIf va_mods
                            win
                            (qblock va_mods
                                (fun (va_s: va_state) ->
                                    va_QSeq va_range1
                                      "***** PRECONDITION NOT MET AT line 260 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                      (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1)
                                          (va_op_reg_opr64_reg64 rRdx)
                                          (va_op_xmm_xmm 0)
                                          80
                                          Secret
                                          hkeys_b
                                          5)
                                      (va_QSeq va_range1
                                          "***** PRECONDITION NOT MET AT line 261 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                          (va_quick_Mov64 (va_op_dst_opr64_reg64 rR8)
                                              (va_op_opr64_reg64 rRcx))
                                          (va_QEmpty (())))))
                            (qblock va_mods
                                (fun (va_s: va_state) ->
                                    va_QSeq va_range1
                                      "***** PRECONDITION NOT MET AT line 265 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                      (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1)
                                          (va_op_reg_opr64_reg64 rRsi)
                                          (va_op_xmm_xmm 0)
                                          80
                                          Secret
                                          hkeys_b
                                          5)
                                      (va_QSeq va_range1
                                          "***** PRECONDITION NOT MET AT line 266 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                          (va_quick_Mov64 (va_op_dst_opr64_reg64 rR8)
                                              (va_op_opr64_reg64 rRdi))
                                          (va_QEmpty (()))))))
                        (fun (va_s: va_state) va_g ->
                            va_QSeq va_range1
                              "***** PRECONDITION NOT MET AT line 268 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                              (va_quick_AESEncryptBlock alg
                                  (va_get_xmm 0 va_s)
                                  key
                                  (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s)
                                      roundkeys_b)
                                  roundkeys_b)
                              (va_QBind va_range1
                                  "***** PRECONDITION NOT MET AT line 269 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                  (va_quick_Pshufb (va_op_xmm_xmm 0) (va_op_xmm_xmm 4))
                                  (fun (va_s: va_state) _ ->
                                      va_QBind va_range1
                                        "***** PRECONDITION NOT MET AT line 270 column 15 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                        (va_qInlineIf va_mods
                                            win
                                            (qblock va_mods
                                                (fun (va_s: va_state) ->
                                                    va_QSeq va_range1
                                                      "***** PRECONDITION NOT MET AT line 272 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                      (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx)
                                                          (va_op_opr64_reg64 rRdx))
                                                      (va_QEmpty (()))))
                                            (qblock va_mods
                                                (fun (va_s: va_state) ->
                                                    va_QSeq va_range1
                                                      "***** PRECONDITION NOT MET AT line 276 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                      (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx)
                                                          (va_op_opr64_reg64 rRsi))
                                                      (va_QEmpty (())))))
                                        (fun (va_s: va_state) va_g ->
                                            va_QBind va_range1
                                              "***** PRECONDITION NOT MET AT line 278 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                              (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1
                                                  )
                                                  (va_op_reg_opr64_reg64 rRcx)
                                                  (va_op_xmm_xmm 0)
                                                  32
                                                  Secret
                                                  hkeys_b
                                                  2)
                                              (fun (va_s: va_state) _ ->
                                                  va_QBind va_range1
                                                    "***** PRECONDITION NOT MET AT line 280 column 17 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                    (va_quick_Gf128_powers (Vale.Math.Poly2.Bits_s.of_quad32
                                                            (va_get_xmm 0 va_s))
                                                        hkeys_b)
                                                    (fun (va_s: va_state) _ ->
                                                        va_qAssertSquash va_range1
                                                          "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 282 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                          ((fun
                                                                (alg_10584:
                                                                  Vale.AES.AES_common_s.algorithm)
                                                                (key_10585:
                                                                  (FStar.Seq.Base.seq Vale.Def.Types_s.nat32
                                                                    ))
                                                                (input_LE_10586:
                                                                  Vale.Def.Types_s.quad32)
                                                                ->
                                                                Vale.AES.AES_s.is_aes_key_LE alg_10584
                                                                  key_10585) alg
                                                              key
                                                              (Vale.Def.Words_s.Mkfour
                                                                  #Vale.Def.Types_s.nat32 0 0 0 0))
                                                          (fun _ ->
                                                              let va_arg27:Vale.Def.Types_s.quad32 =
                                                                Vale.Def.Types_s.reverse_bytes_quad32
                                                                  (Vale.AES.AES_s.aes_encrypt_LE alg
                                                                      key
                                                                      (Vale.Def.Words_s.Mkfour
                                                                          #Vale.Def.Types_s.nat32
                                                                          0
                                                                          0
                                                                          0
                                                                          0))
                                                              in
                                                              let va_arg26:(FStar.Seq.Base.seq Vale.Def.Types_s.quad32
                                                                ) =
                                                                Vale.X64.Decls.s128 (va_get_mem_heaplet
                                                                      1
                                                                      va_s)
                                                                  hkeys_b
                                                              in
                                                              va_qPURE va_range1
                                                                "***** PRECONDITION NOT MET AT line 282 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                                (fun (_: unit) ->
                                                                    Vale.AES.GHash.lemma_hkeys_reqs_pub_priv
                                                                      va_arg26
                                                                      va_arg27)
                                                                (va_QSeq va_range1
                                                                    "***** PRECONDITION NOT MET AT line 284 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
                                                                    (va_quick_DestroyHeaplets ())
                                                                    (va_QEmpty (())))))))))))))))
Vale.AES.X64.GF128_Init.fst.checked
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.Math.Poly2_s.fsti.checked Vale.Math.Poly2.Words.fsti.checked Vale.Math.Poly2.Lemmas.fsti.checked Vale.Math.Poly2.Bits_s.fsti.checked Vale.Math.Poly2.Bits.fsti.checked Vale.Math.Poly2.fsti.checked Vale.Def.Words_s.fsti.checked Vale.Def.Words.Four_s.fsti.checked Vale.Def.Types_s.fst.checked Vale.Arch.Types.fsti.checked Vale.Arch.HeapImpl.fsti.checked Vale.AES.X64.PolyOps.fsti.checked Vale.AES.X64.GF128_Mul.fsti.checked Vale.AES.X64.AES.fsti.checked Vale.AES.OptPublic.fsti.checked Vale.AES.GHash.fsti.checked Vale.AES.GF128_s.fsti.checked Vale.AES.GF128.fsti.checked Vale.AES.AES_s.fst.checked Vale.AES.AES_common_s.fst.checked Vale.AES.AES256_helpers.fsti.checked prims.fst.checked FStar.Seq.Base.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked
Vale.AES.X64.GF128_Init.fst
Vale.X64.QuickCode.va_mods_t Prims.bool Vale.AES.AES_common_s.algorithm FStar.Seq.Base.seq Vale.X64.Memory.nat32 Vale.X64.Memory.buffer128 Vale.X64.QuickCodes.qblock Prims.unit Prims.Cons Vale.X64.Decls.va_code Vale.X64.InsMem.va_code_CreateHeaplets Vale.X64.InsVector.va_code_InitPshufbMask Vale.X64.Decls.va_op_xmm_xmm Vale.X64.Decls.va_op_reg_opr64_reg64 Vale.X64.Machine_s.rR8 Vale.X64.InsVector.va_code_ZeroXmm Vale.X64.QuickCodes.if_code Vale.X64.QuickCodes.block Vale.X64.InsVector.va_code_Store128_buffer Vale.X64.Decls.va_op_heaplet_mem_heaplet Vale.X64.Machine_s.rRdx Vale.Arch.HeapTypes_s.Secret Vale.X64.InsBasic.va_code_Mov64 Vale.X64.Decls.va_op_dst_opr64_reg64 Vale.X64.Decls.va_op_opr64_reg64 Vale.X64.Machine_s.rRcx Prims.Nil Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp Vale.X64.Machine_s.rRsi Vale.X64.Machine_s.rRdi Vale.AES.X64.AES.va_code_AESEncryptBlock Vale.X64.InsVector.va_code_Pshufb Vale.AES.X64.GF128_Init.va_code_Gf128_powers Vale.X64.Machine_s.Block Vale.X64.InsMem.va_code_DestroyHeaplets Vale.X64.Decls.va_state Vale.X64.QuickCodes.va_QSeq Vale.X64.QuickCodes.va_range1 Vale.X64.InsMem.va_quick_CreateHeaplets Vale.Arch.HeapImpl.buffer_info Vale.X64.InsMem.declare_buffer128 Vale.Arch.HeapImpl.Immutable Vale.Arch.HeapImpl.Mutable Vale.X64.InsVector.va_quick_InitPshufbMask Vale.X64.QuickCodes.va_QBind Vale.X64.InsVector.va_quick_ZeroXmm Vale.X64.QuickCodes.va_qInlineIf Vale.X64.InsVector.va_quick_Store128_buffer Vale.X64.InsBasic.va_quick_Mov64 Vale.X64.QuickCodes.va_QEmpty Vale.X64.QuickCodes.quickCodes Vale.AES.X64.AES.va_quick_AESEncryptBlock Vale.X64.Decls.va_get_xmm Vale.X64.Decls.buffer128_as_seq Vale.X64.Decls.va_get_mem_heaplet Vale.X64.InsVector.va_quick_Pshufb Vale.AES.X64.GF128_Init.va_quick_Gf128_powers Vale.Math.Poly2.Bits_s.of_quad32 Vale.X64.QuickCodes.va_qAssertSquash Vale.AES.AES_s.is_aes_key_LE Prims.squash Vale.X64.QuickCodes.va_qPURE Prims.pure_post Prims.l_and Prims.l_True Prims.l_Forall Prims.l_imp Prims.l_iff Vale.AES.OptPublic.hkeys_reqs_pub Vale.AES.GHash.hkeys_reqs_priv Vale.AES.GHash.lemma_hkeys_reqs_pub_priv Vale.X64.InsMem.va_quick_DestroyHeaplets Vale.Def.Types_s.quad32 Vale.X64.Decls.s128 Vale.Def.Types_s.reverse_bytes_quad32 Vale.AES.AES_s.aes_encrypt_LE Vale.Def.Words_s.Mkfour Vale.Def.Types_s.nat32 Vale.X64.Decls.va_int_range Vale.X64.Decls.va_if Vale.Def.Types_s.nat64 Prims.b2t Vale.X64.Decls.va_get_reg64 Prims.l_not Vale.X64.State.vale_state Vale.X64.QuickCode.va_quickCode Vale.AES.X64.GF128_Init.va_code_Keyhash_init
module Vale.AES.X64.GF128_Init
open Vale.Def.Words_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
open FStar.Seq
open Vale.Arch.Types
open Vale.Arch.HeapImpl
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.AES.GHash
open Vale.AES.AES_s
open Vale.AES.AES256_helpers
open Vale.AES.X64.AES
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.X64.CPU_Features_s
open Vale.AES.X64.PolyOps
open Vale.AES.X64.GF128_Mul
open Vale.AES.GHash
open Vale.AES.OptPublic
//-- ShiftKey1_128

val va_code_ShiftKey1_128 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_ShiftKey1_128 () =
  (va_Block (va_CCons (va_code_Mov128 (va_op_xmm_xmm 1) (va_op_xmm_xmm 3)) (va_CCons
    (va_code_ShiftLeft128_1 ()) (va_CCons (va_code_PolyAnd (va_op_xmm_xmm 3) (va_op_xmm_xmm 5))
    (va_CCons (va_code_Pcmpeqd (va_op_xmm_xmm 3) (va_op_xmm_xmm 5)) (va_CCons (va_code_Pshufd
    (va_op_xmm_xmm 3) (va_op_xmm_xmm 3) 255) (va_CCons (va_code_PolyAnd (va_op_xmm_xmm 3)
    (va_op_xmm_xmm 4)) (va_CCons (va_code_VPolyAdd (va_op_xmm_xmm 1) (va_op_xmm_xmm 1)
    (va_op_opr128_xmm 3)) (va_CNil ())))))))))

val va_codegen_success_ShiftKey1_128 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_ShiftKey1_128 () =
  (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 1) (va_op_xmm_xmm 3)) (va_pbool_and
    (va_codegen_success_ShiftLeft128_1 ()) (va_pbool_and (va_codegen_success_PolyAnd (va_op_xmm_xmm
    3) (va_op_xmm_xmm 5)) (va_pbool_and (va_codegen_success_Pcmpeqd (va_op_xmm_xmm 3)
    (va_op_xmm_xmm 5)) (va_pbool_and (va_codegen_success_Pshufd (va_op_xmm_xmm 3) (va_op_xmm_xmm 3)
    255) (va_pbool_and (va_codegen_success_PolyAnd (va_op_xmm_xmm 3) (va_op_xmm_xmm 4))
    (va_pbool_and (va_codegen_success_VPolyAdd (va_op_xmm_xmm 1) (va_op_xmm_xmm 1)
    (va_op_opr128_xmm 3)) (va_ttrue ()))))))))

[@ "opaque_to_smt" va_qattr]
let va_qcode_ShiftKey1_128 (va_mods:va_mods_t) (f:poly) : (va_quickCode unit (va_code_ShiftKey1_128
  ())) =
  (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
    (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s) in let
    (h1:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2_s.shift h 1 in let
    (offset:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s) in
    va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 87 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 1) (va_op_xmm_xmm 3)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 88 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftLeft128_1 h) (fun (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 89 column 28 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Bits.lemma_of_to_quad32_mask h1) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 90 column 25 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.lemma_shift_define_i h 1 128) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 92 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_PolyAnd (va_op_xmm_xmm 3) (va_op_xmm_xmm 5)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 93 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Pcmpeqd (va_op_xmm_xmm 3) (va_op_xmm_xmm 5)) (fun (va_s:va_state) _ -> va_qPURE
    va_range1
    "***** PRECONDITION NOT MET AT line 94 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_test_high_bit h) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 95 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Pshufd (va_op_xmm_xmm 3) (va_op_xmm_xmm 3) 255) (fun (va_s:va_state) _ -> va_qPURE
    va_range1
    "***** PRECONDITION NOT MET AT line 96 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Words.lemma_quad32_zero ()) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 97 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Words.lemma_quad32_ones ()) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 100 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_PolyAnd (va_op_xmm_xmm 3) (va_op_xmm_xmm 4)) (fun (va_s:va_state) _ -> va_qPURE
    va_range1
    "***** PRECONDITION NOT MET AT line 101 column 21 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Lemmas.lemma_and_consts ()) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 102 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_VPolyAdd (va_op_xmm_xmm 1) (va_op_xmm_xmm 1) (va_op_opr128_xmm 3)) (va_QEmpty
    (()))))))))))))))))


val va_lemma_ShiftKey1_128 : va_b0:va_code -> va_s0:va_state -> f:poly
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_ShiftKey1_128 ()) va_s0 /\ va_get_ok va_s0 /\ (let
    (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s0) in let
    (h1:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2_s.shift h 1 in let
    (offset:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0) in
    avx_enabled /\ sse_enabled /\ Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 5 va_s0) ==
    Vale.Math.Poly2_s.monomial 127 /\ offset == Vale.Math.Poly2_s.reverse (Vale.Math.Poly2_s.shift
    (Vale.Math.Poly2_s.add (Vale.Math.Poly2_s.monomial 128) f) (-1)) 127)))
  (ensures (fun (va_sM, va_fM) -> 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 (va_get_xmm 3 va_s0) in let
    (h1:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2_s.shift h 1 in let
    (offset:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GF128.shift_key_1 128 f h) /\
    va_state_eq va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM
    (va_update_flags va_sM (va_update_ok va_sM va_s0)))))))
[@"opaque_to_smt"]
let va_lemma_ShiftKey1_128 va_b0 va_s0 f =
  let (va_mods:va_mods_t) = [va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags; va_Mod_ok] in
  let va_qc = va_qcode_ShiftKey1_128 va_mods f in
  let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_ShiftKey1_128 ()) va_qc va_s0 (fun
    va_s0 va_sM va_g -> let () = va_g in label va_range1
    "***** POSTCONDITION NOT MET AT line 68 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_xmm 3 va_s0) in let (h1:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2_s.shift h 1 in let
    (offset:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0) in
    label va_range1
    "***** POSTCONDITION NOT MET AT line 85 column 50 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GF128.shift_key_1 128 f h)))
    in
  assert_norm (va_qc.mods == va_mods);
  va_lemma_norm_mods ([va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags; va_Mod_ok]) va_sM
    va_s0;
  (va_sM, va_fM)

[@ va_qattr]
let va_wp_ShiftKey1_128 (f:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
  (va_get_ok va_s0 /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_xmm 3 va_s0) in let (h1:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2_s.shift h 1 in let
    (offset:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0) in
    avx_enabled /\ sse_enabled /\ Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 5 va_s0) ==
    Vale.Math.Poly2_s.monomial 127 /\ offset == Vale.Math.Poly2_s.reverse (Vale.Math.Poly2_s.shift
    (Vale.Math.Poly2_s.add (Vale.Math.Poly2_s.monomial 128) f) (-1)) 127) /\ (forall
    (va_x_efl:Vale.X64.Flags.t) (va_x_xmm1:quad32) (va_x_xmm2:quad32) (va_x_xmm3:quad32) . let
    va_sM = va_upd_xmm 3 va_x_xmm3 (va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_flags
    va_x_efl va_s0))) in va_get_ok va_sM /\ (let (h:Vale.Math.Poly2_s.poly) =
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s0) in let (h1:Vale.Math.Poly2_s.poly) =
    Vale.Math.Poly2_s.shift h 1 in let (offset:Vale.Math.Poly2_s.poly) =
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 4 va_s0) in Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_xmm 1 va_sM) == Vale.AES.GF128.shift_key_1 128 f h) ==> va_k va_sM (())))


val va_wpProof_ShiftKey1_128 : f:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_ShiftKey1_128 f va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftKey1_128 ()) ([va_Mod_xmm 3;
    va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_ShiftKey1_128 f va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_ShiftKey1_128 (va_code_ShiftKey1_128 ()) va_s0 f in
  va_lemma_upd_update va_sM;
  assert (va_state_eq va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM
    (va_update_flags va_sM (va_update_ok va_sM va_s0))))));
  va_lemma_norm_mods ([va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftKey1_128 (f:poly) : (va_quickCode unit (va_code_ShiftKey1_128 ())) =
  (va_QProc (va_code_ShiftKey1_128 ()) ([va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
    (va_wp_ShiftKey1_128 f) (va_wpProof_ShiftKey1_128 f))
//--
//-- ShiftKey1_gf128_power

val va_code_ShiftKey1_gf128_power : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_ShiftKey1_gf128_power () =
  (va_Block (va_CCons (va_code_ZeroXmm (va_op_xmm_xmm 4)) (va_CCons (va_code_ZeroXmm (va_op_xmm_xmm
    5)) (va_CCons (va_code_PinsrdImm (va_op_xmm_xmm 4) 3254779904 3 (va_op_reg_opr64_reg64 rR12))
    (va_CCons (va_code_PinsrdImm (va_op_xmm_xmm 4) 1 0 (va_op_reg_opr64_reg64 rR12)) (va_CCons
    (va_code_PinsrdImm (va_op_xmm_xmm 5) 2147483648 3 (va_op_reg_opr64_reg64 rR12)) (va_CCons
    (va_code_ShiftKey1_128 ()) (va_CNil ()))))))))

val va_codegen_success_ShiftKey1_gf128_power : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_ShiftKey1_gf128_power () =
  (va_pbool_and (va_codegen_success_ZeroXmm (va_op_xmm_xmm 4)) (va_pbool_and
    (va_codegen_success_ZeroXmm (va_op_xmm_xmm 5)) (va_pbool_and (va_codegen_success_PinsrdImm
    (va_op_xmm_xmm 4) 3254779904 3 (va_op_reg_opr64_reg64 rR12)) (va_pbool_and
    (va_codegen_success_PinsrdImm (va_op_xmm_xmm 4) 1 0 (va_op_reg_opr64_reg64 rR12)) (va_pbool_and
    (va_codegen_success_PinsrdImm (va_op_xmm_xmm 5) 2147483648 3 (va_op_reg_opr64_reg64 rR12))
    (va_pbool_and (va_codegen_success_ShiftKey1_128 ()) (va_ttrue ())))))))

[@ "opaque_to_smt" va_qattr]
let va_qcode_ShiftKey1_gf128_power (va_mods:va_mods_t) (h:poly) (n:nat) : (va_quickCode unit
  (va_code_ShiftKey1_gf128_power ())) =
  (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
    (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s) in va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 119 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ZeroXmm (va_op_xmm_xmm 4)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 120 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ZeroXmm (va_op_xmm_xmm 5)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 121 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_PinsrdImm (va_op_xmm_xmm 4) 3254779904 3 (va_op_reg_opr64_reg64 rR12)) (va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 122 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_PinsrdImm (va_op_xmm_xmm 4) 1 0 (va_op_reg_opr64_reg64 rR12)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 123 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_PinsrdImm (va_op_xmm_xmm 5) 2147483648 3 (va_op_reg_opr64_reg64 rR12)) (fun
    (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 124 column 25 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_gf128_high_bit ()) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 125 column 28 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_gf128_low_shift_1 ()) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 127 column 18 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_128 gf128_modulus_low_terms) (fun (va_s:va_state) _ -> let
    (va_arg16:Prims.nat) = n in let (va_arg15:Vale.Math.Poly2_s.poly) = h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 128 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_gf128_power va_arg15 va_arg16) (va_QEmpty (()))))))))))))


val va_lemma_ShiftKey1_gf128_power : va_b0:va_code -> va_s0:va_state -> h:poly -> n:nat
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_ShiftKey1_gf128_power ()) va_s0 /\ va_get_ok va_s0 /\
    (let (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s0) in
    avx_enabled /\ sse_enabled /\ hn == Vale.AES.GHash.g_power h n)))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    (let (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GHash.gf128_power h n) /\
    va_state_eq 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_reg64 rR12 va_sM (va_update_flags
    va_sM (va_update_ok va_sM va_s0))))))))))
[@"opaque_to_smt"]
let va_lemma_ShiftKey1_gf128_power va_b0 va_s0 h n =
  let (va_mods:va_mods_t) = [va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1;
    va_Mod_reg64 rR12; va_Mod_flags; va_Mod_ok] in
  let va_qc = va_qcode_ShiftKey1_gf128_power va_mods h n in
  let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_ShiftKey1_gf128_power ()) va_qc va_s0
    (fun va_s0 va_sM va_g -> let () = va_g in label va_range1
    "***** POSTCONDITION NOT MET AT line 105 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ (let (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_xmm 3 va_s0) in label va_range1
    "***** POSTCONDITION NOT MET AT line 117 column 45 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GHash.gf128_power h n))) in
  assert_norm (va_qc.mods == va_mods);
  va_lemma_norm_mods ([va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1;
    va_Mod_reg64 rR12; va_Mod_flags; va_Mod_ok]) va_sM va_s0;
  (va_sM, va_fM)

[@ va_qattr]
let va_wp_ShiftKey1_gf128_power (h:poly) (n:nat) (va_s0:va_state) (va_k:(va_state -> unit ->
  Type0)) : Type0 =
  (va_get_ok va_s0 /\ (let (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_xmm 3 va_s0) in avx_enabled /\ sse_enabled /\ hn == Vale.AES.GHash.g_power h n) /\
    (forall (va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
    (va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) . let va_sM = 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_reg64 rR12 va_x_r12 (va_upd_flags va_x_efl va_s0)))))) in va_get_ok va_sM /\ (let
    (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 3 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GHash.gf128_power h n) ==>
    va_k va_sM (())))


val va_wpProof_ShiftKey1_gf128_power : h:poly -> n:nat -> va_s0:va_state -> va_k:(va_state -> unit
  -> Type0)
  -> Ghost (va_state & va_fuel & unit)
  (requires (va_t_require va_s0 /\ va_wp_ShiftKey1_gf128_power h n va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftKey1_gf128_power ()) ([va_Mod_xmm
    5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags])
    va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_ShiftKey1_gf128_power h n va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_ShiftKey1_gf128_power (va_code_ShiftKey1_gf128_power ()) va_s0 h n
    in
  va_lemma_upd_update va_sM;
  assert (va_state_eq 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_reg64 rR12 va_sM (va_update_flags
    va_sM (va_update_ok va_sM va_s0)))))))));
  va_lemma_norm_mods ([va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1;
    va_Mod_reg64 rR12; va_Mod_flags]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)

[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftKey1_gf128_power (h:poly) (n:nat) : (va_quickCode unit
  (va_code_ShiftKey1_gf128_power ())) =
  (va_QProc (va_code_ShiftKey1_gf128_power ()) ([va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3;
    va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags]) (va_wp_ShiftKey1_gf128_power h n)
    (va_wpProof_ShiftKey1_gf128_power h n))
//--
//-- Gf128_powers

val va_code_Gf128_powers : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Gf128_powers () =
  (va_Block (va_CCons (va_code_Mov128 (va_op_xmm_xmm 0) (va_op_xmm_xmm 6)) (va_CCons (va_code_Mov64
    (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR12)) (va_CCons (va_code_Load128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64 rRcx) 32 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_CCons (va_code_Mov128
    (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons (va_code_ShiftKey1_gf128_power ()) (va_CCons
    (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 0 Secret) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 1) (va_op_xmm_xmm 6))
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_CCons
    (va_code_Gf128MulRev128 ()) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1))
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 16 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_CCons
    (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret) (va_CCons (va_code_Gf128MulRev128 ()) (va_CCons (va_code_Mov128 (va_op_xmm_xmm
    6) (va_op_xmm_xmm 1)) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 48 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_CCons
    (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret) (va_CCons (va_code_Gf128MulRev128 ()) (va_CCons (va_code_Mov128 (va_op_xmm_xmm
    6) (va_op_xmm_xmm 1)) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 64 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_CCons
    (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret) (va_CCons (va_code_Gf128MulRev128 ()) (va_CCons (va_code_Mov128 (va_op_xmm_xmm
    6) (va_op_xmm_xmm 1)) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 96 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_CCons
    (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret) (va_CCons (va_code_Gf128MulRev128 ()) (va_CCons (va_code_Mov128 (va_op_xmm_xmm
    6) (va_op_xmm_xmm 1)) (va_CCons (va_code_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 112 Secret)
    (va_CCons (va_code_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 0)) (va_CCons (va_code_Mov64
    (va_op_dst_opr64_reg64 rR12) (va_op_opr64_reg64 rRax)) (va_CNil
    ()))))))))))))))))))))))))))))))))))))))))))))))

val va_codegen_success_Gf128_powers : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Gf128_powers () =
  (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 0) (va_op_xmm_xmm 6)) (va_pbool_and
    (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR12)) (va_pbool_and
    (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1)
    (va_op_reg_opr64_reg64 rRcx) 32 Secret) (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm
    6) (va_op_xmm_xmm 1)) (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm
    1)) (va_pbool_and (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and
    (va_codegen_success_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 0 Secret) (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 1)
    (va_op_xmm_xmm 6)) (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm
    6)) (va_pbool_and (va_codegen_success_Gf128MulRev128 ()) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 16 Secret)
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_pbool_and
    (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1)
    (va_op_reg_opr64_reg64 rRcx) 32 Secret) (va_pbool_and (va_codegen_success_Gf128MulRev128 ())
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 48 Secret)
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_pbool_and
    (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1)
    (va_op_reg_opr64_reg64 rRcx) 32 Secret) (va_pbool_and (va_codegen_success_Gf128MulRev128 ())
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 64 Secret)
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_pbool_and
    (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1)
    (va_op_reg_opr64_reg64 rRcx) 32 Secret) (va_pbool_and (va_codegen_success_Gf128MulRev128 ())
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 96 Secret)
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_pbool_and
    (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1)
    (va_op_reg_opr64_reg64 rRcx) 32 Secret) (va_pbool_and (va_codegen_success_Gf128MulRev128 ())
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 1) 112 Secret)
    (va_pbool_and (va_codegen_success_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 0)) (va_pbool_and
    (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR12) (va_op_opr64_reg64 rRax)) (va_ttrue
    ())))))))))))))))))))))))))))))))))))))))))))))

[@ "opaque_to_smt" va_qattr]
let va_qcode_Gf128_powers (va_mods:va_mods_t) (h:poly) (hkeys_b:buffer128) : (va_quickCode unit
  (va_code_Gf128_powers ())) =
  (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 158 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 0) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR12)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 161 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret hkeys_b 2) (fun (va_s:va_state) _ -> let (va_arg57:Vale.Math.Poly2_s.poly) = h
    in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 162 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_1 va_arg57) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 163 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 164 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 165 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 1) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 166 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 0 Secret hkeys_b 0) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 168 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 1) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 169 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 170 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg56:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 171 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_n va_arg56 1) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 172 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 173 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 174 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 2) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 175 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 16 Secret hkeys_b 1) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 177 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 178 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret hkeys_b 2) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 179 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 180 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_n va_arg55 2) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 181 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 182 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 183 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 3) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 184 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 48 Secret hkeys_b 3) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 186 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 187 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret hkeys_b 2) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 188 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg54:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 189 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_n va_arg54 3) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 190 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 191 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 192 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 4) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 193 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 64 Secret hkeys_b 4) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 195 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 196 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret hkeys_b 2) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 197 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg53:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 198 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_n va_arg53 4) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 199 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 200 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 201 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 5) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 202 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 96 Secret hkeys_b 6) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 204 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 2) (va_op_xmm_xmm 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 205 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_xmm_xmm 1) (va_op_reg_opr64_reg64
    rRcx) 32 Secret hkeys_b 2) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 206 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 207 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash.lemma_g_power_n va_arg52 5) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 208 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 209 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 3) (va_op_xmm_xmm 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 210 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 6) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 211 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx)
    (va_op_xmm_xmm 1) 112 Secret hkeys_b 7) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 213 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov128 (va_op_xmm_xmm 6) (va_op_xmm_xmm 0)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 214 column 10 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_quick_Mov64 (va_op_dst_opr64_reg64 rR12) (va_op_opr64_reg64 rRax)) (va_QEmpty
    (())))))))))))))))))))))))))))))))))))))))))))))))))))))


val va_lemma_Gf128_powers : va_b0:va_code -> va_s0:va_state -> h:poly -> hkeys_b:buffer128
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Gf128_powers ()) va_s0 /\ va_get_ok va_s0 /\
    (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.X64.Decls.validDstAddrs128
    (va_get_mem_heaplet 1 va_s0) (va_get_reg64 rRcx va_s0) hkeys_b 8 (va_get_mem_layout va_s0)
    Secret /\ Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 2
    (va_get_mem_heaplet 1 va_s0)) == h))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    va_get_xmm 6 va_sM == va_get_xmm 6 va_s0 /\ va_get_reg64 rR12 va_sM == va_get_reg64 rR12 va_s0
    /\ Vale.X64.Decls.modifies_mem (Vale.X64.Decls.loc_buffer #Vale.X64.Memory.vuint128 hkeys_b)
    (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 1 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 1 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 2 /\ Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1
    va_sM) == Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0) /\
    Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 3 (va_get_mem_heaplet 1
    va_sM)) == Vale.AES.GHash.gf128_power h 3 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 4 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 4 /\ Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1
    va_sM) == Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1 va_s0) /\
    Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 6 (va_get_mem_heaplet 1
    va_sM)) == Vale.AES.GHash.gf128_power h 5 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 7 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 6 /\ va_state_eq 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 rR12 va_sM (va_update_reg64 rRax va_sM
    (va_update_flags 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_Gf128_powers va_b0 va_s0 h hkeys_b =
  let (va_mods:va_mods_t) = [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 rR12; va_Mod_reg64 rRax; va_Mod_flags;
    va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem] in
  let va_qc = va_qcode_Gf128_powers va_mods h hkeys_b in
  let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Gf128_powers ()) va_qc va_s0 (fun va_s0
    va_sM va_g -> let () = va_g in label va_range1
    "***** POSTCONDITION NOT MET AT line 131 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 145 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_get_xmm 6 va_sM == va_get_xmm 6 va_s0) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 146 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (va_get_reg64 rR12 va_sM == va_get_reg64 rR12 va_s0) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 147 column 61 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.X64.Decls.modifies_mem (Vale.X64.Decls.loc_buffer #Vale.X64.Memory.vuint128 hkeys_b)
    (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM)) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 148 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 1) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 149 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 1 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 2) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 151 column 84 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_sM) ==
    Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0)) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 152 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 3 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 3) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 153 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 4 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 4) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 154 column 84 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1 va_sM) ==
    Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1 va_s0)) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 155 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 6 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 5) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 156 column 74 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/x64/Vale.AES.X64.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 7 (va_get_mem_heaplet
    1 va_sM)) == Vale.AES.GHash.gf128_power h 6)) in
  assert_norm (va_qc.mods == va_mods);
  va_lemma_norm_mods ([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 rR12; va_Mod_reg64 rRax; va_Mod_flags;
    va_Mod_mem_heaplet 1; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
  (va_sM, va_fM)

[@ va_qattr]
let va_wp_Gf128_powers (h:poly) (hkeys_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit ->
  Type0)) : Type0 =
  (va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\
    Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg64 rRcx va_s0) hkeys_b
    8 (va_get_mem_layout va_s0) Secret /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0)) == h /\ (forall
    (va_x_mem:vale_heap) (va_x_heap1:vale_heap) (va_x_efl:Vale.X64.Flags.t) (va_x_rax:nat64)
    (va_x_r12: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) . let va_sM = 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 rR12 va_x_r12 (va_upd_reg64 rRax
    va_x_rax (va_upd_flags va_x_efl (va_upd_mem_heaplet 1 va_x_heap1 (va_upd_mem va_x_mem
    va_s0))))))))))) in va_get_ok va_sM /\ va_get_xmm 6 va_sM == va_get_xmm 6 va_s0 /\ va_get_reg64
    rR12 va_sM == va_get_reg64 rR12 va_s0 /\ Vale.X64.Decls.modifies_mem (Vale.X64.Decls.loc_buffer
    #Vale.X64.Memory.vuint128 hkeys_b) (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1 va_sM) /\
    Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet 1
    va_sM)) == Vale.AES.GHash.gf128_power h 1 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 1 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 2 /\ Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1
    va_sM) == Vale.X64.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0) /\
    Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 3 (va_get_mem_heaplet 1
    va_sM)) == Vale.AES.GHash.gf128_power h 3 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 4 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 4 /\ Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1
    va_sM) == Vale.X64.Decls.buffer128_read hkeys_b 5 (va_get_mem_heaplet 1 va_s0) /\
    Vale.Math.Poly2.Bits_s.of_quad32 (Vale.X64.Decls.buffer128_read hkeys_b 6 (va_get_mem_heaplet 1
    va_sM)) == Vale.AES.GHash.gf128_power h 5 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.X64.Decls.buffer128_read hkeys_b 7 (va_get_mem_heaplet 1 va_sM)) ==
    Vale.AES.GHash.gf128_power h 6 ==> va_k va_sM (())))


val va_wpProof_Gf128_powers : h:poly -> hkeys_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_Gf128_powers h hkeys_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Gf128_powers ()) ([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 rR12; va_Mod_reg64 rRax; va_Mod_flags; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0
    va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Gf128_powers h hkeys_b va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Gf128_powers (va_code_Gf128_powers ()) va_s0 h hkeys_b in
  va_lemma_upd_update va_sM;
  assert (va_state_eq 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 rR12 va_sM (va_update_reg64 rRax va_sM (va_update_flags 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_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 rR12; va_Mod_reg64 rRax; va_Mod_flags;
    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_Gf128_powers (h:poly) (hkeys_b:buffer128) : (va_quickCode unit (va_code_Gf128_powers
  ())) =
  (va_QProc (va_code_Gf128_powers ()) ([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 rR12; va_Mod_reg64 rRax; va_Mod_flags;
    va_Mod_mem_heaplet 1; va_Mod_mem]) (va_wp_Gf128_powers h hkeys_b) (va_wpProof_Gf128_powers h
    hkeys_b))
//--
//-- Keyhash_init

[@ "opaque_to_smt" va_qattr]
let va_code_Keyhash_init win alg =
  (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_InitPshufbMask (va_op_xmm_xmm
    4) (va_op_reg_opr64_reg64 rR8)) (va_CCons (va_code_ZeroXmm (va_op_xmm_xmm 0)) (va_CCons (if win
    then va_Block (va_CCons (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1)
    (va_op_reg_opr64_reg64 rRdx) (va_op_xmm_xmm 0) 80 Secret) (va_CCons (va_code_Mov64
    (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CNil ()))) else va_Block (va_CCons
    (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRsi)
    (va_op_xmm_xmm 0) 80 Secret) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR8)
    (va_op_opr64_reg64 rRdi)) (va_CNil ())))) (va_CCons (va_code_AESEncryptBlock alg) (va_CCons
    (va_code_Pshufb (va_op_xmm_xmm 0) (va_op_xmm_xmm 4)) (va_CCons (if win then va_Block (va_CCons
    (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRdx)) (va_CNil ())) else
    va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRsi))
    (va_CNil ()))) (va_CCons (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1)
    (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 0) 32 Secret) (va_CCons (va_code_Gf128_powers ())
    (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
    ())))))))))))))

[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Keyhash_init win alg =
  (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and
    (va_codegen_success_InitPshufbMask (va_op_xmm_xmm 4) (va_op_reg_opr64_reg64 rR8)) (va_pbool_and
    (va_codegen_success_ZeroXmm (va_op_xmm_xmm 0)) (va_pbool_and (if win then va_pbool_and
    (va_codegen_success_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRdx)
    (va_op_xmm_xmm 0) 80 Secret) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64
    rR8) (va_op_opr64_reg64 rRcx)) (va_ttrue ())) else va_pbool_and
    (va_codegen_success_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRsi)
    (va_op_xmm_xmm 0) 80 Secret) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64
    rR8) (va_op_opr64_reg64 rRdi)) (va_ttrue ()))) (va_pbool_and
    (va_codegen_success_AESEncryptBlock alg) (va_pbool_and (va_codegen_success_Pshufb
    (va_op_xmm_xmm 0) (va_op_xmm_xmm 4)) (va_pbool_and (if win then va_pbool_and
    (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRdx)) (va_ttrue ())
    else va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64
    rRsi)) (va_ttrue ())) (va_pbool_and (va_codegen_success_Store128_buffer
    (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rRcx) (va_op_xmm_xmm 0) 32 Secret)
    (va_pbool_and (va_codegen_success_Gf128_powers ()) (va_pbool_and
    (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))

[@ "opaque_to_smt" va_qattr]
let va_qcode_Keyhash_init (va_mods:va_mods_t) (win:bool) (alg:algorithm) (key:(seq nat32))
val va_qcode_Keyhash_init
      (va_mods: va_mods_t)
      (win: bool)
      (alg: algorithm)
      (key: (seq nat32))
      (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init win alg))

    va_mods: Vale.X64.QuickCode.va_mods_t ->
    win: Prims.bool ->
    alg: Vale.AES.AES_common_s.algorithm ->
    key: FStar.Seq.Base.seq Vale.X64.Memory.nat32 ->
    roundkeys_b: Vale.X64.Memory.buffer128 ->
    hkeys_b: Vale.X64.Memory.buffer128
  -> Vale.X64.QuickCode.va_quickCode Prims.unit
      (Vale.AES.X64.GF128_Init.va_code_Keyhash_init win alg)