(* 3^e in GF(2^8) *)
Definition exp3 (e: nat): int := ff_exp (Int.repr 3) (Int.repr (Z.of_nat e)).

(* Specifications: *)
Lemma exp3_S: forall n, (0 <= n <= 256)%nat -> (* even holds for bigger n, as long as no int overflow *) exp3 (S n) = ff_mult (Int.repr 3) (exp3 n).
Lemma exp3_S_slow: forall n, (0 <= n <= 256)%nat -> (* even holds for bigger n, as long as no int overflow *) exp3 (S n) = ff_mult (Int.repr 3) (exp3 n).
Lemma ff_exp_range: forall a b, 0 <= a < 256 -> 0 <= b < 256 -> 0 <= Int.unsigned (ff_exp (Int.repr a) (Int.repr b)) < 256.
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).