Definition hSalsaOut x :=
           QuadByte2ValList (littleendian_invert (Znth 0  x)) ++
           QuadByte2ValList (littleendian_invert (Znth 5  x)) ++
           QuadByte2ValList (littleendian_invert (Znth 10 x)) ++
           QuadByte2ValList (littleendian_invert (Znth 15 x)) ++
           QuadByte2ValList (littleendian_invert (Znth 6  x)) ++
           QuadByte2ValList (littleendian_invert (Znth 7  x)) ++
           QuadByte2ValList (littleendian_invert (Znth 8  x)) ++
           QuadByte2ValList (littleendian_invert (Znth 9  x)).Parameter SIGMA: SixteenByte.Definition Sigma_vector : val -> mpred :=
  data_at Tsh (tarray tuchar 16) (SixteenByte2ValList SIGMA).Fixpoint ZZ (zbytes: list byte) (n: nat): int * list byte :=
  match n with
   O => (Int.one, zbytes)
  | S k => match ZZ zbytes k with (u,zb) =>
             let v := (Int.unsigned u + (Byte.unsigned (Znth (Z.of_nat k+8) zb)))
             in (Int.shru (Int.repr v) (Int.repr 8),
                 upd_Znth (Z.of_nat k+8) zb (Byte.repr (Z.modulo v 256))) end

  end.Fixpoint ZCont (r: nat) (zcont: list byte): list byte :=
  match r with
     O => zcont
   | S n => let zb := ZCont n zcont in
            let zz := ZZ zb (8:nat) in snd zz
  end.

Lemma ZCont0 bytes: ZCont O bytes = bytes.