val va_wp_ShiftKey1_128 (f: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
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_wp_ShiftKey1_128 (f: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
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 (())))
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.Math.Poly2_s.poly Vale.PPC64LE.Decls.va_state Prims.unit Prims.l_and Prims.b2t Vale.PPC64LE.Decls.va_get_ok Prims.eq2 Vale.Math.Poly2.Bits_s.of_quad32 Vale.PPC64LE.Decls.va_get_vec Vale.Math.Poly2_s.monomial Vale.Math.Poly2_s.reverse Vale.Math.Poly2_s.shift Vale.Math.Poly2_s.add Prims.op_Minus Prims.l_Forall Vale.PPC64LE.Memory.quad32 Prims.l_imp Vale.AES.GF128.shift_key_1 Vale.PPC64LE.Machine_s.state Vale.PPC64LE.Decls.va_upd_vec
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]
val va_wp_ShiftKey1_128 (f: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0

    f: Vale.Math.Poly2_s.poly ->
    va_s0: Vale.PPC64LE.Decls.va_state ->
    va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
  -> Type0