Perform all the rounds in a permutation.
(all-rounds stat constants alpha partial-first-p mds full-rounds-half partial-rounds prime) → new-stat
We pass the number of initial and final full rounds
Function:
(defun all-rounds (stat constants alpha partial-first-p mds full-rounds-half partial-rounds prime) (declare (xargs :guard (and (integerp alpha) (booleanp partial-first-p) (natp full-rounds-half) (natp partial-rounds) (primep prime) (fe-listp stat prime) (fe-list-listp constants prime) (fe-list-listp mds prime)))) (declare (xargs :guard (and (all-len-equal-p constants (len stat)) (equal (len constants) (+ (* 2 full-rounds-half) partial-rounds)) (all-len-equal-p mds (len stat)) (equal (len mds) (len stat))))) (let ((__function__ 'all-rounds)) (declare (ignorable __function__)) (b* ((full-rounds-first-constants (take full-rounds-half constants)) (partial-rounds-constants (take partial-rounds (nthcdr full-rounds-half constants))) (full-rounds-last-constants (nthcdr (+ full-rounds-half partial-rounds) constants)) (stat (full-rounds stat full-rounds-first-constants alpha partial-first-p mds prime)) (stat (partial-rounds stat partial-rounds-constants alpha partial-first-p mds prime)) (stat (full-rounds stat full-rounds-last-constants alpha partial-first-p mds prime))) stat)))
Theorem:
(defthm fe-listp-of-all-rounds (implies (and (primep prime) (fe-listp stat prime)) (b* ((new-stat (all-rounds stat constants alpha partial-first-p mds full-rounds-half partial-rounds prime))) (fe-listp new-stat prime))) :rule-classes :rewrite)
Theorem:
(defthm len-of-all-rounds (implies (equal (len mds) (len stat)) (b* ((?new-stat (all-rounds stat constants alpha partial-first-p mds full-rounds-half partial-rounds prime))) (equal (len new-stat) (len stat)))))
Theorem:
(defthm nat-listp-of-all-rounds (implies (and (primep prime) (fe-listp stat prime)) (b* ((?new-stat (all-rounds stat constants alpha partial-first-p mds full-rounds-half partial-rounds prime))) (nat-listp new-stat))))