val va_wpProof_Keyhash_init : alg:algorithm -> key:(seq nat32) -> roundkeys_b:buffer128 ->
  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_Keyhash_init alg key roundkeys_b hkeys_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Keyhash_init alg) ([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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Keyhash_init alg key roundkeys_b hkeys_b va_s0 va_k =
  let (va_sM, va_f0) = va_lemma_Keyhash_init (va_code_Keyhash_init alg) va_s0 alg key roundkeys_b
    hkeys_b 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_mem_layout 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 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_mem_layout; va_Mod_mem_heaplet 1;
    va_Mod_mem]) va_sM va_s0;
  let va_g = () in
  (va_sM, va_f0, va_g)
val va_wpProof_Keyhash_init : alg:algorithm -> key:(seq nat32) -> roundkeys_b:buffer128 ->
  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_Keyhash_init alg key roundkeys_b hkeys_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Keyhash_init alg) ([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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Keyhash_init alg key roundkeys_b hkeys_b va_s0 va_k =
let va_sM, va_f0 =
  va_lemma_Keyhash_init (va_code_Keyhash_init alg) va_s0 alg key roundkeys_b hkeys_b
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_mem_layout 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 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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_mem
    ])
  va_sM
  va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
Vale.AES.PPC64LE.GF128_Init.fst.checked
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.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.Types_helpers.fsti.checked Vale.AES.PPC64LE.PolyOps.fsti.checked Vale.AES.PPC64LE.GF128_Mul.fsti.checked Vale.AES.PPC64LE.AES.fsti.checked Vale.AES.OptPublic_BE.fsti.checked Vale.AES.GHash_BE.fsti.checked Vale.AES.GF128_s.fsti.checked Vale.AES.GF128.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
Vale.AES.PPC64LE.GF128_Init.fst
Vale.AES.AES_common_s.algorithm 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 Vale.PPC64LE.QuickCode.va_Mod_mem_layout Vale.PPC64LE.QuickCode.va_Mod_mem_heaplet Vale.PPC64LE.QuickCode.va_Mod_mem 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_mem_layout Vale.PPC64LE.Decls.va_update_mem_heaplet Vale.PPC64LE.Decls.va_update_ok Vale.PPC64LE.Decls.va_update_mem Vale.PPC64LE.Decls.va_lemma_upd_update FStar.Pervasives.Native.tuple3 FStar.Pervasives.Native.tuple2 Vale.PPC64LE.Machine_s.state Vale.AES.PPC64LE.GF128_Init.va_lemma_Keyhash_init Vale.AES.PPC64LE.GF128_Init.va_code_Keyhash_init
module Vale.AES.PPC64LE.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_BE
open Vale.AES.AES_BE_s
open Vale.AES.AES256_helpers_BE
open Vale.AES.PPC64LE.AES
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.AES.PPC64LE.PolyOps
open Vale.AES.PPC64LE.GF128_Mul
open Vale.AES.OptPublic_BE
//-- 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_Vmr (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 3)) (va_CCons
    (va_code_ShiftLeft128_1 ()) (va_CCons (va_code_VPolyAnd (va_op_vec_opr_vec 3)
    (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5)) (va_CCons (va_code_Vcmpequw (va_op_vec_opr_vec 3)
    (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5)) (va_CCons (va_code_Vspltw (va_op_vec_opr_vec 3)
    (va_op_vec_opr_vec 3) 0) (va_CCons (va_code_VPolyAnd (va_op_vec_opr_vec 3) (va_op_vec_opr_vec
    3) (va_op_vec_opr_vec 4)) (va_CCons (va_code_VPolyAdd (va_op_vec_opr_vec 1) (va_op_vec_opr_vec
    1) (va_op_vec_opr_vec 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_Vmr (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 3)) (va_pbool_and
    (va_codegen_success_ShiftLeft128_1 ()) (va_pbool_and (va_codegen_success_VPolyAnd
    (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5)) (va_pbool_and
    (va_codegen_success_Vcmpequw (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5))
    (va_pbool_and (va_codegen_success_Vspltw (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) 0)
    (va_pbool_and (va_codegen_success_VPolyAnd (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3)
    (va_op_vec_opr_vec 4)) (va_pbool_and (va_codegen_success_VPolyAdd (va_op_vec_opr_vec 1)
    (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 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_vec 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_vec 4 va_s) in
    va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 79 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 3)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 80 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_ShiftLeft128_1 h) (fun (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 81 column 28 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Bits.lemma_of_to_quad32_mask h1) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 82 column 25 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.lemma_shift_define_i h 1 128) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 84 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_VPolyAnd (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5)) (va_QBind
    va_range1
    "***** PRECONDITION NOT MET AT line 85 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vcmpequw (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 5)) (fun
    (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 86 column 24 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_test_high_bit h) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 87 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vspltw (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) 0) (fun (va_s:va_state) _ ->
    va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 88 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Words.lemma_quad32_zero ()) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 89 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Words.lemma_quad32_ones ()) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 92 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_VPolyAnd (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 4)) (fun
    (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 93 column 21 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.Math.Poly2.Lemmas.lemma_and_consts ()) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 94 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_VPolyAdd (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 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_vec 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_vec 4 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 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_vec 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_vec 4 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.shift_key_1 128 f h) /\
    va_state_eq va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 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_vec 3; va_Mod_vec 2; va_Mod_vec 1; 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 62 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ (let (h:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_vec 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_vec 4 va_s0) in
    label va_range1
    "***** POSTCONDITION NOT MET AT line 77 column 48 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 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_vec 3; va_Mod_vec 2; va_Mod_vec 1; 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_vec 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_vec 4 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 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_v1:quad32) (va_x_v2:quad32)
    (va_x_v3:quad32) . let va_sM = va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1
    va_s0)) in va_get_ok va_sM /\ (let (h:Vale.Math.Poly2_s.poly) =
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 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_vec 4 va_s0) in Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_vec 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_vec 3;
    va_Mod_vec 2; va_Mod_vec 1]) 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_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM
    (va_update_ok va_sM va_s0)))));
  va_lemma_norm_mods ([va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1]) 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_vec 3; va_Mod_vec 2; va_Mod_vec 1])
    (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_Vspltisw (va_op_vec_opr_vec 1) 0) (va_CCons (va_code_Vspltisw
    (va_op_vec_opr_vec 2) 1) (va_CCons (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) (-15872))
    (va_CCons (va_code_Mtvsrws (va_op_vec_opr_vec 4) (va_op_reg_opr_reg 10)) (va_CCons
    (va_code_LoadImmShl64 (va_op_reg_opr_reg 10) (-32768)) (va_CCons (va_code_Mtvsrws
    (va_op_vec_opr_vec 5) (va_op_reg_opr_reg 10)) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4)
    (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 1) 8) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 5)
    (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 1) 12) (va_CCons (va_code_Vsldoi (va_op_vec_opr_vec 4)
    (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 2) 4) (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_Vspltisw (va_op_vec_opr_vec 1) 0) (va_pbool_and
    (va_codegen_success_Vspltisw (va_op_vec_opr_vec 2) 1) (va_pbool_and
    (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) (-15872)) (va_pbool_and
    (va_codegen_success_Mtvsrws (va_op_vec_opr_vec 4) (va_op_reg_opr_reg 10)) (va_pbool_and
    (va_codegen_success_LoadImmShl64 (va_op_reg_opr_reg 10) (-32768)) (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_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 1) 8)
    (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5)
    (va_op_vec_opr_vec 1) 12) (va_pbool_and (va_codegen_success_Vsldoi (va_op_vec_opr_vec 4)
    (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 2) 4) (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_vec 3 va_s) in va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 110 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vspltisw (va_op_vec_opr_vec 1) 0) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 111 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vspltisw (va_op_vec_opr_vec 2) 1) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 112 column 17 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) (-15872)) (fun (va_s:va_state) _ -> let
    (va_arg24:Vale.Def.Types_s.nat64) = (-15872) `op_Modulus` pow2_64 in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 113 column 18 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.Types_helpers.lemma_ishl_64 va_arg24 16) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 114 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Mtvsrws (va_op_vec_opr_vec 4) (va_op_reg_opr_reg 10)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 115 column 17 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_LoadImmShl64 (va_op_reg_opr_reg 10) (-32768)) (fun (va_s:va_state) _ -> let
    (va_arg23:Vale.Def.Types_s.nat64) = (-32768) `op_Modulus` pow2_64 in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 116 column 18 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.Types_helpers.lemma_ishl_64 va_arg23 16) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 117 column 12 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.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 118 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 1) 8) (va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 119 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vsldoi (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 5) (va_op_vec_opr_vec 1) 12)
    (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 120 column 11 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vsldoi (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 4) (va_op_vec_opr_vec 2) 4) (fun
    (va_s:va_state) _ -> va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 121 column 25 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_gf128_high_bit ()) (va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 122 column 28 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GF128.lemma_gf128_low_shift_1 ()) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 124 column 18 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_128 gf128_modulus_low_terms) (fun (va_s:va_state) _ -> let
    (va_arg22:Prims.nat) = n in let (va_arg21:Vale.Math.Poly2_s.poly) = h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 125 column 22 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash_BE.lemma_gf128_power va_arg21 va_arg22) (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_vec 3 va_s0) in hn
    == Vale.AES.GHash_BE.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_vec 3 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GHash_BE.gf128_power h n) /\
    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_reg 10 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_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1;
    va_Mod_reg 10; 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 97 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ (let (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
    (va_get_vec 3 va_s0) in label va_range1
    "***** POSTCONDITION NOT MET AT line 108 column 43 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GHash_BE.gf128_power h n)))
    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_reg 10; 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_vec 3 va_s0) in hn == Vale.AES.GHash_BE.g_power h n) /\ (forall (va_x_r10:nat64)
    (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_reg 10 va_x_r10 va_s0))))) in va_get_ok va_sM /\ (let
    (hn:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 3 va_s0) in
    Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GHash_BE.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_vec
    5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_reg 10]) 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_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_reg 10 va_sM (va_update_ok 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_reg 10]) 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_vec 5; va_Mod_vec 4; va_Mod_vec 3;
    va_Mod_vec 2; va_Mod_vec 1; va_Mod_reg 10]) (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_LoadImm64 (va_op_reg_opr_reg 10) 32) (va_CCons
    (va_code_Load128_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_CCons (va_code_Vmr (va_op_vec_opr_vec
    6) (va_op_vec_opr_vec 1)) (va_CCons (va_code_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1))
    (va_CCons (va_code_ShiftKey1_gf128_power ()) (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_Vmr (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Vmr
    (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_CCons (va_code_Gf128MulRev128 ()) (va_CCons
    (va_code_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1)) (va_CCons
    (va_code_ShiftKey1_gf128_power ()) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10) 16)
    (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_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_LoadImm64 (va_op_reg_opr_reg 10) 32) (va_pbool_and
    (va_codegen_success_Load128_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_pbool_and
    (va_codegen_success_Vmr (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 1)) (va_pbool_and
    (va_codegen_success_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (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_Vmr (va_op_vec_opr_vec 1)
    (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Vmr (va_op_vec_opr_vec 2)
    (va_op_vec_opr_vec 6)) (va_pbool_and (va_codegen_success_Gf128MulRev128 ()) (va_pbool_and
    (va_codegen_success_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1)) (va_pbool_and
    (va_codegen_success_ShiftKey1_gf128_power ()) (va_pbool_and (va_codegen_success_LoadImm64
    (va_op_reg_opr_reg 10) 16) (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_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 147 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 32) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 148 column 32 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Load128_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 hkeys_b 2) (fun (va_s:va_state) _ -> let
    (va_arg18:Vale.Math.Poly2_s.poly) = h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 149 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash_BE.lemma_g_power_1 va_arg18) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 150 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 6) (va_op_vec_opr_vec 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 151 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 152 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 1) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 153 column 27 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.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 hkeys_b 0) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 155 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 1) (va_op_vec_opr_vec 6)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 156 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 2) (va_op_vec_opr_vec 6)) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 157 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Gf128MulRev128 ()) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Math.Poly2_s.poly) =
    h in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 158 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash_BE.lemma_g_power_n va_arg17 1) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 159 column 8 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vmr (va_op_vec_opr_vec 3) (va_op_vec_opr_vec 1)) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 160 column 26 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_ShiftKey1_gf128_power h 2) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 161 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 16) (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 162 column 33 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.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 hkeys_b 1) (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 /\
    Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg 3 va_s0) hkeys_b 3
    (va_get_mem_layout va_s0) Secret /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.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 /\
    Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Decls.loc_buffer #Vale.PPC64LE.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.Def.Types_s.reverse_bytes_quad32
    (Vale.PPC64LE.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet 1 va_sM))) ==
    Vale.AES.GHash_BE.gf128_power h 1 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read hkeys_b 1
    (va_get_mem_heaplet 1 va_sM))) == Vale.AES.GHash_BE.gf128_power h 2 /\
    Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_sM) ==
    Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0) /\ 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_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_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_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 128 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 141 column 61 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Decls.loc_buffer #Vale.PPC64LE.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 142 column 96 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32
    (Vale.PPC64LE.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet 1 va_sM))) ==
    Vale.AES.GHash_BE.gf128_power h 1) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 143 column 96 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.Math.Poly2.Bits_s.of_quad32 (Vale.Def.Types_s.reverse_bytes_quad32
    (Vale.PPC64LE.Decls.buffer128_read hkeys_b 1 (va_get_mem_heaplet 1 va_sM))) ==
    Vale.AES.GHash_BE.gf128_power h 2) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 145 column 84 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_sM) ==
    Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0))) 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_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 /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_s0) (va_get_reg
    3 va_s0) hkeys_b 3 (va_get_mem_layout va_s0) Secret /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.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_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_upd_mem_heaplet 1
    va_x_heap1 (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\
    Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Decls.loc_buffer #Vale.PPC64LE.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.Def.Types_s.reverse_bytes_quad32
    (Vale.PPC64LE.Decls.buffer128_read hkeys_b 0 (va_get_mem_heaplet 1 va_sM))) ==
    Vale.AES.GHash_BE.gf128_power h 1 /\ Vale.Math.Poly2.Bits_s.of_quad32
    (Vale.Def.Types_s.reverse_bytes_quad32 (Vale.PPC64LE.Decls.buffer128_read hkeys_b 1
    (va_get_mem_heaplet 1 va_sM))) == Vale.AES.GHash_BE.gf128_power h 2 /\
    Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_sM) ==
    Vale.PPC64LE.Decls.buffer128_read hkeys_b 2 (va_get_mem_heaplet 1 va_s0) ==> 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_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_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_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_mem_heaplet 1 va_sM (va_update_ok va_sM (va_update_mem 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_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_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_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 alg =
  (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Vspltisw (va_op_vec_opr_vec 0)
    0) (va_CCons (va_code_AESEncryptBlock alg) (va_CCons (va_code_LoadImm64 (va_op_reg_opr_reg 10)
    32) (va_CCons (va_code_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1)
    (va_op_vec_opr_vec 0) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) 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 alg =
  (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Vspltisw
    (va_op_vec_opr_vec 0) 0) (va_pbool_and (va_codegen_success_AESEncryptBlock alg) (va_pbool_and
    (va_codegen_success_LoadImm64 (va_op_reg_opr_reg 10) 32) (va_pbool_and
    (va_codegen_success_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1)
    (va_op_vec_opr_vec 0) (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) 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) (alg:algorithm) (key:(seq nat32))
  (roundkeys_b:buffer128) (hkeys_b:buffer128) : (va_quickCode unit (va_code_Keyhash_init alg)) =
  (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 192 column 19 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_CreateHeaplets ([declare_buffer128 roundkeys_b 0 Secret Immutable; declare_buffer128
    hkeys_b 1 Secret Mutable])) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 196 column 13 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Vspltisw (va_op_vec_opr_vec 0) 0) (fun (va_s:va_state) _ -> va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 197 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_AESEncryptBlock alg (va_get_vec 0 va_s) key (Vale.Arch.Types.reverse_bytes_quad32_seq
    (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s) roundkeys_b)) roundkeys_b)
    (va_QSeq va_range1
    "***** PRECONDITION NOT MET AT line 198 column 14 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_LoadImm64 (va_op_reg_opr_reg 10) 32) (va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Store128_byte16_buffer_index (va_op_heaplet_mem_heaplet 1) (va_op_vec_opr_vec 0)
    (va_op_reg_opr_reg 3) (va_op_reg_opr_reg 10) Secret hkeys_b 2) (fun (va_s:va_state) _ ->
    va_QBind va_range1
    "***** PRECONDITION NOT MET AT line 201 column 17 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_Gf128_powers (Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 0 va_s)) hkeys_b) (fun
    (va_s:va_state) _ -> va_qAssertSquash va_range1
    "***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 203 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    ((fun (alg_10536:Vale.AES.AES_common_s.algorithm) (key_10537:(FStar.Seq.Base.seq
    Vale.Def.Types_s.nat32)) (input_10538:Vale.Def.Types_s.quad32) ->
    Vale.AES.AES_BE_s.is_aes_key_word alg_10536 key_10537) alg key (Vale.Def.Words_s.Mkfour
    #Vale.Def.Types_s.nat32 0 0 0 0)) (fun _ -> let (va_arg12:Vale.Def.Types_s.quad32) =
    Vale.AES.AES_BE_s.aes_encrypt_word alg key (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0
    0 0) in let (va_arg11:(FStar.Seq.Base.seq Vale.Def.Types_s.quad32)) =
    Vale.Arch.Types.reverse_bytes_quad32_seq (Vale.PPC64LE.Decls.s128 (va_get_mem_heaplet 1 va_s)
    hkeys_b) in va_qPURE va_range1
    "***** PRECONDITION NOT MET AT line 203 column 30 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (fun (_:unit) -> Vale.AES.GHash_BE.lemma_hkeys_reqs_pub_priv va_arg11 va_arg12) (va_QSeq
    va_range1
    "***** PRECONDITION NOT MET AT line 205 column 20 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))



[@"opaque_to_smt"]
let va_lemma_Keyhash_init va_b0 va_s0 alg key roundkeys_b hkeys_b =
  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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_ok;
    va_Mod_mem] in
  let va_qc = va_qcode_Keyhash_init va_mods alg key roundkeys_b hkeys_b in
  let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Keyhash_init alg) va_qc va_s0 (fun
    va_s0 va_sM va_g -> let () = va_g in label va_range1
    "***** POSTCONDITION NOT MET AT line 165 column 1 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (va_get_ok va_sM) /\ label va_range1
    "***** POSTCONDITION NOT MET AT line 189 column 51 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.PPC64LE.Decls.modifies_buffer128 hkeys_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
    va_range1
    "***** POSTCONDITION NOT MET AT line 190 column 117 of file /home/gebner/everest/hacl-star/vale/code/crypto/aes/ppc64le/Vale.AES.PPC64LE.GF128_Init.vaf *****"
    (Vale.AES.OptPublic_BE.hkeys_reqs_pub (Vale.Arch.Types.reverse_bytes_quad32_seq
    (Vale.PPC64LE.Decls.s128 (va_get_mem va_sM) hkeys_b)) (Vale.AES.AES_BE_s.aes_encrypt_word alg
    key (Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0)))) 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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_ok;
    va_Mod_mem]) va_sM va_s0;
  (va_sM, va_fM)
val va_wpProof_Keyhash_init : alg:algorithm -> key:(seq nat32) -> roundkeys_b:buffer128 ->
  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_Keyhash_init alg key roundkeys_b hkeys_b va_s0 va_k))
  (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Keyhash_init alg) ([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_mem_layout; va_Mod_mem_heaplet 1; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))

    alg: Vale.AES.AES_common_s.algorithm ->
    key: FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 ->
    roundkeys_b: Vale.PPC64LE.Memory.buffer128 ->
    hkeys_b: 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)