Module SalsaGeneralizedCascade <: GeneralizedCascade.
Definition K1:Type := ThirtyTwoByte.
Definition I1:Type := SixteenByte.
Definition K2:Type := ThirtyTwoByte.
Definition H: K1 -> I1 -> K2 := HSalsa20 10.
Definition I2:Type := SixteenByte.
Definition L:Type := SixtyFourByte.
Definition X (k1:K1) (i1: I1) (i2: I2): L :=
match i1 with (((x, y), z), u) =>
match i2 with (((a, b), c), d) =>
XSalsa20 10 k1 (x, y, z, u, a, b) (c, d)
end end.
Definition S (k: K2) (i: I2) : L :=
match k with (((((((k0, k1), k2), k3), k4), k5), k6), k7) =>
Salsa20K0K1 (((k0, k1), k2), k3) (((k4, k5), k6), k7) i
end.

Lemma X_char k1 i1 i2: X k1 i1 i2 = S (H k1 i1) i2.