Absorb any number of elements into the sponge.
(absorb inputs sponge param) → new-sponge
We use absorb1 on each input, threading the sponge state through the sequence.
Function:
(defun absorb (inputs sponge param) (declare (xargs :guard (and (spongep sponge) (paramp param) (fe-listp inputs (param->prime param))))) (declare (xargs :guard (sponge-validp sponge param))) (let ((__function__ 'absorb)) (declare (ignorable __function__)) (b* (((when (endp inputs)) (sponge-fix sponge)) (sponge (absorb1 (car inputs) sponge param))) (absorb (cdr inputs) sponge param))))
Theorem:
(defthm spongep-of-absorb (b* ((new-sponge (absorb inputs sponge param))) (spongep new-sponge)) :rule-classes :rewrite)
Theorem:
(defthm sponge-validp-of-absorb (implies (sponge-validp sponge param) (b* ((new-sponge (absorb inputs sponge param))) (sponge-validp new-sponge param))) :rule-classes :rewrite)