Apply the partial S-box substitution to the state vector.
(sub-words-partial stat alpha partial-first-p prime) → new-stat
We raise to the
Function:
(defun sub-words-partial (stat alpha partial-first-p prime) (declare (xargs :guard (and (integerp alpha) (booleanp partial-first-p) (primep prime) (fe-listp stat prime)))) (let ((__function__ 'sub-words-partial)) (declare (ignorable __function__)) (if (consp stat) (if partial-first-p (cons (pow-by-alpha (car stat) alpha prime) (cdr stat)) (append (butlast stat 1) (list (pow-by-alpha (car (last stat)) alpha prime)))) nil)))
Theorem:
(defthm fe-listp-of-sub-words-partial (implies (and (primep prime) (fe-listp stat prime)) (b* ((new-stat (sub-words-partial stat alpha partial-first-p prime))) (fe-listp new-stat prime))) :rule-classes :rewrite)
Theorem:
(defthm len-of-sub-words-partial (b* ((?new-stat (sub-words-partial stat alpha partial-first-p prime))) (equal (len new-stat) (len stat))))