module Vale.Wrapper.X64.GCMdecryptOpt256 open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open Vale.AsLowStar.MemoryHelpers open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.Def.Types_s open Vale.AES.GCM_helpers open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.AES.GHash_s open Vale.AES.GCTR_s open Vale.AES.GCTR open Vale.Interop.Base open Vale.Arch.Types open Vale.AES.OptPublic let uint8_p = B.buffer UInt8.t let uint64 = UInt64.t let disjoint_or_eq (b1 b2:uint8_p) = B.disjoint b1 b2 \/ b1 == b2 let length_aux (b:uint8_p) : Lemma (requires B.length b = 176) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux2 (b:uint8_p) : Lemma (requires B.length b = 240) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux3 (b:uint8_p) (n:nat) : Lemma (requires B.length b = 16 * n) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db; FStar.Math.Lemmas.cancel_mul_mod n 16 let length_aux4 (b:uint8_p) : Lemma (requires B.length b = 16) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db let length_aux5 (b:uint8_p) : Lemma (requires B.length b = 128) (ensures DV.length (get_downview b) % 16 = 0) = let db = get_downview b in DV.length_eq db inline_for_extraction val gcm256_decrypt_opt_stdcall: Vale.Wrapper.X64.GCMdecryptOpt.decrypt_opt_stdcall_st AES_256