Definition padlen' (n: Z) : list Int.int :=
let q := (n+8)/64*16 + 15 - (n+8)/4   (* number of zero-pad words *)
in zeros q ++ [Int.repr (n * 8 / Int.modulus); Int.repr (n * 8)].

(* Specifications: *)
Lemma padlen_eq: padlen=padlen'.
Lemma length_generate_and_pad'':
forall (l: list byte) (k: Z),
k >= 0 ->
k + Zlength (generate_and_pad' l (k*4)) = roundup (((k*4+Zlength l)+12)/4) 16.
Lemma length_generate_and_pad':
forall (l: list byte),
Zlength (generate_and_pad' l 0) = roundup ((Zlength l +12)/4) 16.
Lemma roundup_ge:
forall a b,  b > 0 -> roundup a b >= a.
Lemma generate_and_pad'_eq:
generate_and_pad = generate_and_pad_alt.
Lemma roundup_divide:
forall a b, b > 0 ->  (b | roundup a b).
Lemma length_generate_and_pad:
forall (l: list byte),
Zlength (generate_and_pad l) = roundup ((Zlength l +12)/4) 16.