val va_quick_Keyhash_init (alg: algorithm) (key: (seq nat32)) (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init alg))
let va_quick_Keyhash_init (alg:algorithm) (key:(seq nat32)) (roundkeys_b:buffer128)
  (hkeys_b:buffer128) : (va_quickCode unit (va_code_Keyhash_init alg)) =
  (va_QProc (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_wp_Keyhash_init alg key roundkeys_b hkeys_b) (va_wpProof_Keyhash_init alg
    key roundkeys_b hkeys_b))
val va_quick_Keyhash_init (alg: algorithm) (key: (seq nat32)) (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init alg))
let va_quick_Keyhash_init (alg: algorithm) (key: (seq nat32)) (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init alg)) =
(va_QProc (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_wp_Keyhash_init alg key roundkeys_b hkeys_b)
    (va_wpProof_Keyhash_init alg key roundkeys_b hkeys_b))
Vale.AES.PPC64LE.GF128_Init.fsti.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.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.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.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked
Vale.AES.PPC64LE.GF128_Init.fsti
Vale.AES.AES_common_s.algorithm FStar.Seq.Base.seq Vale.PPC64LE.Memory.nat32 Vale.PPC64LE.Memory.buffer128 Vale.PPC64LE.QuickCode.va_QProc Prims.unit Vale.AES.PPC64LE.GF128_Init.va_code_Keyhash_init 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 Vale.AES.PPC64LE.GF128_Init.va_wp_Keyhash_init Vale.AES.PPC64LE.GF128_Init.va_wpProof_Keyhash_init Vale.PPC64LE.QuickCode.va_quickCode
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
//-- Keyhash_init

val va_code_Keyhash_init : alg:algorithm -> Tot va_code

val va_codegen_success_Keyhash_init : alg:algorithm -> Tot va_pbool
let va_req_Keyhash_init (va_b0:va_code) (va_s0:va_state) (alg:algorithm) (key:(seq nat32))
  (roundkeys_b:buffer128) (hkeys_b:buffer128) : prop =
  (va_require_total va_b0 (va_code_Keyhash_init alg) va_s0 /\ va_get_ok va_s0 /\
    Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (alg =
    AES_128 \/ alg = AES_256) /\ Vale.PPC64LE.Decls.buffers_disjoint128 roundkeys_b hkeys_b /\
    Vale.AES.AES_BE_s.is_aes_key_word alg key /\ Vale.Arch.Types.reverse_bytes_quad32_seq
    (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem va_s0) roundkeys_b) ==
    Vale.AES.AES_BE_s.key_to_round_keys_word alg key /\ Vale.PPC64LE.Decls.validSrcAddrs128
    (va_get_mem va_s0) (va_get_reg 4 va_s0) roundkeys_b (Vale.AES.AES_common_s.nr alg + 1)
    (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem va_s0)
    (va_get_reg 3 va_s0) hkeys_b 3 (va_get_mem_layout va_s0) Secret)
let va_ens_Keyhash_init (va_b0:va_code) (va_s0:va_state) (alg:algorithm) (key:(seq nat32))
  (roundkeys_b:buffer128) (hkeys_b:buffer128) (va_sM:va_state) (va_fM:va_fuel) : prop =
  (va_req_Keyhash_init va_b0 va_s0 alg key roundkeys_b hkeys_b /\ va_ensure_total va_b0 va_s0 va_sM
    va_fM /\ va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_buffer128 hkeys_b (va_get_mem va_s0)
    (va_get_mem va_sM) /\ 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)) /\ 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)))))))))))))

val va_lemma_Keyhash_init : va_b0:va_code -> va_s0:va_state -> alg:algorithm -> key:(seq nat32) ->
  roundkeys_b:buffer128 -> hkeys_b:buffer128
  -> Ghost (va_state & va_fuel)
  (requires (va_require_total va_b0 (va_code_Keyhash_init alg) va_s0 /\ va_get_ok va_s0 /\
    Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (alg =
    AES_128 \/ alg = AES_256) /\ Vale.PPC64LE.Decls.buffers_disjoint128 roundkeys_b hkeys_b /\
    Vale.AES.AES_BE_s.is_aes_key_word alg key /\ Vale.Arch.Types.reverse_bytes_quad32_seq
    (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem va_s0) roundkeys_b) ==
    Vale.AES.AES_BE_s.key_to_round_keys_word alg key /\ Vale.PPC64LE.Decls.validSrcAddrs128
    (va_get_mem va_s0) (va_get_reg 4 va_s0) roundkeys_b (Vale.AES.AES_common_s.nr alg + 1)
    (va_get_mem_layout va_s0) Secret /\ Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem va_s0)
    (va_get_reg 3 va_s0) hkeys_b 3 (va_get_mem_layout va_s0) Secret))
  (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
    Vale.PPC64LE.Decls.modifies_buffer128 hkeys_b (va_get_mem va_s0) (va_get_mem va_sM) /\
    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)) /\ 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_qattr]
let va_wp_Keyhash_init (alg:algorithm) (key:(seq nat32)) (roundkeys_b:buffer128)
  (hkeys_b:buffer128) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
  (va_get_ok va_s0 /\ Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem
    va_s0) /\ (alg = AES_128 \/ alg = AES_256) /\ Vale.PPC64LE.Decls.buffers_disjoint128
    roundkeys_b hkeys_b /\ Vale.AES.AES_BE_s.is_aes_key_word alg key /\
    Vale.Arch.Types.reverse_bytes_quad32_seq (Vale.PPC64LE.Decls.buffer128_as_seq (va_get_mem
    va_s0) roundkeys_b) == Vale.AES.AES_BE_s.key_to_round_keys_word alg key /\
    Vale.PPC64LE.Decls.validSrcAddrs128 (va_get_mem va_s0) (va_get_reg 4 va_s0) roundkeys_b
    (Vale.AES.AES_common_s.nr alg + 1) (va_get_mem_layout va_s0) Secret /\
    Vale.PPC64LE.Decls.validDstAddrs128 (va_get_mem va_s0) (va_get_reg 3 va_s0) hkeys_b 3
    (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap1:vale_heap)
    (va_x_memLayout:vale_heap_layout) (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_layout va_x_memLayout (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_buffer128 hkeys_b (va_get_mem
    va_s0) (va_get_mem va_sM) /\ 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)) ==> va_k va_sM (())))

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))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Keyhash_init (alg:algorithm) (key:(seq nat32)) (roundkeys_b:buffer128)
val va_quick_Keyhash_init (alg: algorithm) (key: (seq nat32)) (roundkeys_b hkeys_b: buffer128)
    : (va_quickCode unit (va_code_Keyhash_init alg))

    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
  -> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
      (Vale.AES.PPC64LE.GF128_Init.va_code_Keyhash_init alg)