val va_ens_Poly1305
      (va_b0: va_code)
      (va_s0: va_state)
      (win: bool)
      (ctx_b inp_b: buffer64)
      (len_in finish_in: nat64)
      (va_sM: va_state)
      (va_fM: va_fuel)
    : prop
let va_ens_Poly1305 (va_b0:va_code) (va_s0:va_state) (win:bool) (ctx_b:buffer64) (inp_b:buffer64)
  (len_in:nat64) (finish_in:nat64) (va_sM:va_state) (va_fM:va_fuel) : prop =
  (va_req_Poly1305 va_b0 va_s0 win ctx_b inp_b len_in finish_in /\ va_ensure_total va_b0 va_s0
    va_sM va_fM /\ va_get_ok va_sM /\ (let (ctx_in:(va_int_range 0 18446744073709551615)) = (if win
    then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inp_in:(va_int_range 0
    18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in
    let (n:(va_int_range 18446744073709551616 18446744073709551616)) = 18446744073709551616 in let
    (p:(va_int_range 1361129467683753853853498429727072845819
    1361129467683753853853498429727072845819)) = va_mul_nat n n `op_Multiply` 4 - 5 in
    Vale.Poly1305.Util.modifies_buffer ctx_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (let h0_in =
    Vale.X64.Decls.buffer64_read ctx_b 0 (va_get_mem va_s0) in let h1_in =
    Vale.X64.Decls.buffer64_read ctx_b 1 (va_get_mem va_s0) in let h2_in =
    Vale.X64.Decls.buffer64_read ctx_b 2 (va_get_mem va_s0) in let key_r0 =
    Vale.X64.Decls.buffer64_read ctx_b 3 (va_get_mem va_s0) in let key_r1 =
    Vale.X64.Decls.buffer64_read ctx_b 4 (va_get_mem va_s0) in let key_s0 =
    Vale.X64.Decls.buffer64_read ctx_b 5 (va_get_mem va_s0) in let key_s1 =
    Vale.X64.Decls.buffer64_read ctx_b 6 (va_get_mem va_s0) in let h_in =
    Vale.Poly1305.Math.lowerUpper192 (Vale.Poly1305.Math.lowerUpper128 h0_in h1_in) h2_in in let
    key_r = Vale.Poly1305.Math.lowerUpper128 key_r0 key_r1 in let key_s =
    Vale.Poly1305.Math.lowerUpper128 key_s0 key_s1 in let h0_out = Vale.X64.Decls.buffer64_read
    ctx_b 0 (va_get_mem va_sM) in let h1_out = Vale.X64.Decls.buffer64_read ctx_b 1 (va_get_mem
    va_sM) in let h2_out = Vale.X64.Decls.buffer64_read ctx_b 2 (va_get_mem va_sM) in let h10 =
    Vale.Poly1305.Math.lowerUpper128 h0_out h1_out in let h210 = Vale.Poly1305.Math.lowerUpper192
    h10 h2_out in let inp_mem = Vale.Poly1305.Util.seqTo128 (Vale.X64.Decls.buffer64_as_seq
    (va_get_mem va_sM) inp_b) in (finish_in == 0 ==> Vale.Poly1305.Spec_s.modp h210 ==
    Vale.Poly1305.Spec_s.poly1305_hash_blocks (Vale.Poly1305.Spec_s.modp h_in) (va_mul_nat n n)
    (Vale.Poly1305.Spec_s.make_r key_r) inp_mem (len_in `op_Division` 16)) /\ (finish_in == 0 ==>
    h2_out < 5) /\ (finish_in == 1 ==> h10 == Vale.Poly1305.Spec_s.poly1305_hash_all
    (Vale.Poly1305.Spec_s.modp h_in) key_r key_s inp_mem len_in) /\ va_get_reg64 rRsp va_sM ==
    va_get_reg64 rRsp va_s0 /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win
    ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ va_get_reg64 rRbx va_sM ==
    va_get_reg64 rRbx va_s0 /\ va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0 /\ va_get_reg64
    rR12 va_sM == va_get_reg64 rR12 va_s0 /\ va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0 /\
    va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 /\ va_get_reg64 rR15 va_sM == va_get_reg64
    rR15 va_s0)) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
    (va_update_mem_layout va_sM (va_update_mem_heaplet 1 va_sM (va_update_flags va_sM
    (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
    (va_update_reg64 rR12 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
    (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM
    (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM
    (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
    (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
    va_s0))))))))))))))))))))))))
val va_ens_Poly1305
      (va_b0: va_code)
      (va_s0: va_state)
      (win: bool)
      (ctx_b inp_b: buffer64)
      (len_in finish_in: nat64)
      (va_sM: va_state)
      (va_fM: va_fuel)
    : prop
let va_ens_Poly1305
      (va_b0: va_code)
      (va_s0: va_state)
      (win: bool)
      (ctx_b inp_b: buffer64)
      (len_in finish_in: nat64)
      (va_sM: va_state)
      (va_fM: va_fuel)
    : prop =
(va_req_Poly1305 va_b0 va_s0 win ctx_b inp_b len_in finish_in /\
  va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
  (let ctx_in:(va_int_range 0 18446744073709551615) =
      (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0)
    in
    let inp_in:(va_int_range 0 18446744073709551615) =
      (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0)
    in
    let n:(va_int_range 18446744073709551616 18446744073709551616) = 18446744073709551616 in
    let p:(va_int_range 1361129467683753853853498429727072845819
        1361129467683753853853498429727072845819) =
      (va_mul_nat n n) `op_Multiply` 4 - 5
    in
    Vale.Poly1305.Util.modifies_buffer ctx_b (va_get_mem va_s0) (va_get_mem va_sM) /\
    (let h0_in = Vale.X64.Decls.buffer64_read ctx_b 0 (va_get_mem va_s0) in
      let h1_in = Vale.X64.Decls.buffer64_read ctx_b 1 (va_get_mem va_s0) in
      let h2_in = Vale.X64.Decls.buffer64_read ctx_b 2 (va_get_mem va_s0) in
      let key_r0 = Vale.X64.Decls.buffer64_read ctx_b 3 (va_get_mem va_s0) in
      let key_r1 = Vale.X64.Decls.buffer64_read ctx_b 4 (va_get_mem va_s0) in
      let key_s0 = Vale.X64.Decls.buffer64_read ctx_b 5 (va_get_mem va_s0) in
      let key_s1 = Vale.X64.Decls.buffer64_read ctx_b 6 (va_get_mem va_s0) in
      let h_in =
        Vale.Poly1305.Math.lowerUpper192 (Vale.Poly1305.Math.lowerUpper128 h0_in h1_in) h2_in
      in
      let key_r = Vale.Poly1305.Math.lowerUpper128 key_r0 key_r1 in
      let key_s = Vale.Poly1305.Math.lowerUpper128 key_s0 key_s1 in
      let h0_out = Vale.X64.Decls.buffer64_read ctx_b 0 (va_get_mem va_sM) in
      let h1_out = Vale.X64.Decls.buffer64_read ctx_b 1 (va_get_mem va_sM) in
      let h2_out = Vale.X64.Decls.buffer64_read ctx_b 2 (va_get_mem va_sM) in
      let h10 = Vale.Poly1305.Math.lowerUpper128 h0_out h1_out in
      let h210 = Vale.Poly1305.Math.lowerUpper192 h10 h2_out in
      let inp_mem =
        Vale.Poly1305.Util.seqTo128 (Vale.X64.Decls.buffer64_as_seq (va_get_mem va_sM) inp_b)
      in
      (finish_in == 0 ==>
        Vale.Poly1305.Spec_s.modp h210 ==
        Vale.Poly1305.Spec_s.poly1305_hash_blocks (Vale.Poly1305.Spec_s.modp h_in)
          (va_mul_nat n n)
          (Vale.Poly1305.Spec_s.make_r key_r)
          inp_mem
          (len_in `op_Division` 16)) /\ (finish_in == 0 ==> h2_out < 5) /\
      (finish_in == 1 ==>
        h10 ==
        Vale.Poly1305.Spec_s.poly1305_hash_all (Vale.Poly1305.Spec_s.modp h_in)
          key_r
          key_s
          inp_mem
          len_in) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0 /\
      (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\
      (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\
      va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\
      va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0 /\
      va_get_reg64 rR12 va_sM == va_get_reg64 rR12 va_s0 /\
      va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0 /\
      va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0 /\
      va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0)) /\
  va_state_eq va_sM
    (va_update_stackTaint va_sM
        (va_update_stack va_sM
            (va_update_mem_layout va_sM
                (va_update_mem_heaplet 1
                    va_sM
                    (va_update_flags va_sM
                        (va_update_reg64 rR15
                            va_sM
                            (va_update_reg64 rR14
                                va_sM
                                (va_update_reg64 rR13
                                    va_sM
                                    (va_update_reg64 rR12
                                        va_sM
                                        (va_update_reg64 rR11
                                            va_sM
                                            (va_update_reg64 rR10
                                                va_sM
                                                (va_update_reg64 rR9
                                                    va_sM
                                                    (va_update_reg64 rR8
                                                        va_sM
                                                        (va_update_reg64 rRsp
                                                            va_sM
                                                            (va_update_reg64 rRbp
                                                                va_sM
                                                                (va_update_reg64 rRdi
                                                                    va_sM
                                                                    (va_update_reg64 rRsi
                                                                        va_sM
                                                                        (va_update_reg64 rRdx
                                                                            va_sM
                                                                            (va_update_reg64 rRcx
                                                                                va_sM
                                                                                (va_update_reg64 rRbx
                                                                                    va_sM
                                                                                    (va_update_reg64
                                                                                        rRax
                                                                                        va_sM
                                                                                        (va_update_ok
                                                                                            va_sM
                                                                                            (va_update_mem
                                                                                                va_sM
                                                                                                va_s0
                                                                                              ))))))
                                                                    ))))))))))))))))))
Vale.Poly1305.X64.fsti.checked
Vale.X64.State.fsti.checked Vale.X64.Stack_i.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.InsStack.fsti.checked Vale.X64.InsMem.fsti.checked Vale.X64.InsBasic.fsti.checked Vale.X64.Flags.fsti.checked Vale.X64.Decls.fsti.checked Vale.Poly1305.Util.fsti.checked Vale.Poly1305.Spec_s.fst.checked Vale.Poly1305.Math.fsti.checked Vale.Def.Types_s.fst.checked Vale.Def.Opaque_s.fsti.checked Vale.Arch.Types.fsti.checked Vale.Arch.HeapImpl.fsti.checked prims.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked
Vale.Poly1305.X64.fsti
Vale.X64.Decls.va_code Vale.X64.Decls.va_state Prims.bool Vale.X64.Memory.buffer64 Vale.X64.Memory.nat64 Vale.X64.Decls.va_fuel Prims.l_and Vale.Poly1305.X64.va_req_Poly1305 Vale.X64.Decls.va_ensure_total Prims.b2t Vale.X64.Decls.va_get_ok Vale.Poly1305.Util.modifies_buffer Vale.X64.Decls.va_get_mem Prims.l_imp Prims.eq2 Prims.int Vale.Poly1305.Spec_s.modp Vale.Poly1305.Spec_s.poly1305_hash_blocks Vale.X64.Decls.va_mul_nat Vale.Poly1305.Spec_s.make_r Prims.op_Division Prims.op_LessThan Vale.Poly1305.Spec_s.poly1305_hash_all Vale.Def.Types_s.nat64 Vale.X64.Decls.va_get_reg64 Vale.X64.Machine_s.rRsp Vale.X64.Machine_s.rRdi Vale.X64.Machine_s.rRsi Vale.X64.Machine_s.rRbx Vale.X64.Machine_s.rRbp Vale.X64.Machine_s.rR12 Vale.X64.Machine_s.rR13 Vale.X64.Machine_s.rR14 Vale.X64.Machine_s.rR15 Vale.Poly1305.Util.t_seqTo128 Vale.Poly1305.Util.seqTo128 Vale.X64.Decls.buffer64_as_seq Vale.Poly1305.Math.lowerUpper192 Vale.Def.Words_s.nat128 Vale.Poly1305.Math.lowerUpper128 Vale.Def.Words_s.nat64 Vale.X64.Decls.buffer64_read Vale.X64.Decls.va_int_range Prims.op_Subtraction Prims.op_Multiply Vale.X64.Machine_s.rRdx Vale.X64.Machine_s.rRcx Vale.X64.Decls.va_state_eq Vale.X64.Decls.va_update_stackTaint Vale.X64.Decls.va_update_stack Vale.X64.Decls.va_update_mem_layout Vale.X64.Decls.va_update_mem_heaplet Vale.X64.Decls.va_update_flags Vale.X64.Decls.va_update_reg64 Vale.X64.Machine_s.rR11 Vale.X64.Machine_s.rR10 Vale.X64.Machine_s.rR9 Vale.X64.Machine_s.rR8 Vale.X64.Machine_s.rRax Vale.X64.Decls.va_update_ok Vale.X64.Decls.va_update_mem Prims.prop
module Vale.Poly1305.X64
open Vale.Def.Opaque_s
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Memory
open Vale.X64.Stack_i
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.Poly1305.Spec_s
open Vale.Poly1305.Math
open Vale.Poly1305.Util
#reset-options "--z3rlimit 40"
//-- Poly1305

val va_code_Poly1305 : win:bool -> Tot va_code

val va_codegen_success_Poly1305 : win:bool -> Tot va_pbool
let va_req_Poly1305 (va_b0:va_code) (va_s0:va_state) (win:bool) (ctx_b:buffer64) (inp_b:buffer64)
  (len_in:nat64) (finish_in:nat64) : prop =
  (va_require_total va_b0 (va_code_Poly1305 win) va_s0 /\ va_get_ok va_s0 /\ (let
    (ctx_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
    va_get_reg64 rRdi va_s0) in let (inp_in:(va_int_range 0 18446744073709551615)) = (if win then
    va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (n:(va_int_range
    18446744073709551616 18446744073709551616)) = 18446744073709551616 in let (p:(va_int_range
    1361129467683753853853498429727072845819 1361129467683753853853498429727072845819)) =
    va_mul_nat n n `op_Multiply` 4 - 5 in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp
    (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem
    va_s0) /\ Vale.X64.Decls.buffers_disjoint ctx_b inp_b /\ Vale.X64.Decls.validDstAddrs64
    (va_get_mem va_s0) ctx_in ctx_b 24 (va_get_mem_layout va_s0) Public /\
    Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inp_in inp_b
    (Vale.Poly1305.Util.readable_words len_in) (va_get_mem_layout va_s0) Public /\ len_in == (if
    win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ finish_in == (if win then
    va_get_reg64 rR9 va_s0 else va_get_reg64 rRcx va_s0) /\ (let h2_in =
    Vale.X64.Decls.buffer64_read ctx_b 2 (va_get_mem va_s0) in h2_in < 5 /\ inp_in + len_in <
    pow2_64 /\ finish_in < 2)))
let va_ens_Poly1305 (va_b0:va_code) (va_s0:va_state) (win:bool) (ctx_b:buffer64) (inp_b:buffer64)
val va_ens_Poly1305
      (va_b0: va_code)
      (va_s0: va_state)
      (win: bool)
      (ctx_b inp_b: buffer64)
      (len_in finish_in: nat64)
      (va_sM: va_state)
      (va_fM: va_fuel)
    : prop

    va_b0: Vale.X64.Decls.va_code ->
    va_s0: Vale.X64.Decls.va_state ->
    win: Prims.bool ->
    ctx_b: Vale.X64.Memory.buffer64 ->
    inp_b: Vale.X64.Memory.buffer64 ->
    len_in: Vale.X64.Memory.nat64 ->
    finish_in: Vale.X64.Memory.nat64 ->
    va_sM: Vale.X64.Decls.va_state ->
    va_fM: Vale.X64.Decls.va_fuel
  -> Prims.prop