val w' (mi: Seq.lseq (word SHA1) (block_word_length SHA1)) (t: nat{t <= 79})
    : GTot (word SHA1) (decreases (t))
let rec w' (mi: Seq.lseq (word SHA1) (block_word_length SHA1)) (t: nat {t <= 79}) : GTot (word SHA1) (decreases (t)) =
  if t < 16
  then Seq.index mi (t)
  else (w' mi (t - 3) ^. w' mi (t - 8) ^. w' mi (t - 14) ^. w' mi (t - 16)) <<<. 1ul
val w' (mi: Seq.lseq (word SHA1) (block_word_length SHA1)) (t: nat{t <= 79})
    : GTot (word SHA1) (decreases (t))
let rec w' (mi: Seq.lseq (word SHA1) (block_word_length SHA1)) (t: nat{t <= 79})
    : GTot (word SHA1) (decreases (t)) =
if t < 16
then Seq.index mi (t)
else (w' mi (t - 3) ^. w' mi (t - 8) ^. w' mi (t - 14) ^. w' mi (t - 16)) <<<. 1ul
Spec.SHA1.fst.checked
Spec.Loops.fst.checked Spec.Hash.Definitions.fst.checked prims.fst.checked Lib.IntTypes.fsti.checked FStar.UInt32.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.Classical.fsti.checked
Spec.SHA1.fst
FStar.Seq.Properties.lseq Spec.Hash.Definitions.word Spec.Hash.Definitions.SHA1 Spec.Hash.Definitions.block_word_length Prims.nat Prims.b2t Prims.op_LessThanOrEqual Prims.op_LessThan FStar.Seq.Base.index Prims.bool Lib.IntTypes.op_Less_Less_Less_Dot Spec.Hash.Definitions.word_t Lib.IntTypes.SEC Lib.IntTypes.op_Hat_Dot Spec.SHA1.w' Prims.op_Subtraction FStar.UInt32.__uint_to_t
module Spec.SHA1

open Lib.IntTypes
module H = Spec.Hash.Definitions
module Seq = FStar.Seq

open Spec.Hash.Definitions
(* Source: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf *)

(* Section 5.3.1 *)

inline_for_extraction
let init_as_list : list uint32 = [
  u32 0x67452301;
  u32 0xefcdab89;
  u32 0x98badcfe;
  u32 0x10325476;
  u32 0xc3d2e1f0;
]

let init : words_state SHA1 = Seq.seq_of_list init_as_list

(* Section 6.1.2 Step 1: message schedule *)
val w' (mi: Seq.lseq (word SHA1) (block_word_length SHA1)) (t: nat{t <= 79})
    : GTot (word SHA1) (decreases (t))

    mi:
      FStar.Seq.Properties.lseq (Spec.Hash.Definitions.word Spec.Hash.Definitions.SHA1)
        (Spec.Hash.Definitions.block_word_length Spec.Hash.Definitions.SHA1) ->
    t: Prims.nat{t <= 79}
  -> Prims.GTot (Spec.Hash.Definitions.word Spec.Hash.Definitions.SHA1)