(* works, but very slow! Lemma exp_table_correct : forall a : nat, (a < 256)%nat -> nth a ff_exp_table Int.zero = exp3 a. *)
(* 3^e in GF(2^8) *)
Definition exp3 (e: nat): int := ff_exp (Int.repr 3) (Int.repr (Z.of_nat e)).

Lemma gen_exp_table_correct : forall n : nat, (n <= 256)%nat ->
forall i : nat, (i < n)%nat ->
nth i (gen_exp_table n (exp3 (256-n))) Int.zero = exp3 (256+i-n).