Check if a sponge state is valid with respect to given parameters.
The state vector must consist of prime field elements,
and must have length equal to
Function:
(defun sponge-validp (sponge param) (declare (xargs :guard (and (spongep sponge) (paramp param)))) (let ((__function__ 'sponge-validp)) (declare (ignorable __function__)) (and (fe-listp (sponge->stat sponge) (param->prime param)) (equal (len (sponge->stat sponge)) (param->size param)) (<= (sponge->index sponge) (param->rate param)))))
Theorem:
(defthm booleanp-of-sponge-validp (b* ((yes/no (sponge-validp sponge param))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm sponge-validp-of-sponge-fix-sponge (equal (sponge-validp (sponge-fix sponge) param) (sponge-validp sponge param)))
Theorem:
(defthm sponge-validp-sponge-equiv-congruence-on-sponge (implies (sponge-equiv sponge sponge-equiv) (equal (sponge-validp sponge param) (sponge-validp sponge-equiv param))) :rule-classes :congruence)
Theorem:
(defthm sponge-validp-of-param-fix-param (equal (sponge-validp sponge (param-fix param)) (sponge-validp sponge param)))
Theorem:
(defthm sponge-validp-param-equiv-congruence-on-param (implies (param-equiv param param-equiv) (equal (sponge-validp sponge param) (sponge-validp sponge param-equiv))) :rule-classes :congruence)