The function that maps each message segment to a scalar.
This is the function that maps
This is a weighted sum of the encodings of the 4-bit windows
(see pedersen-enc).
The sum in [IS] appears to be off by one:
it should end at
Function:
(defun pedersen-scalar-loop (w segment) (declare (xargs :guard (and (natp w) (bit-listp segment)))) (declare (xargs :guard (integerp (/ (len segment) 4)))) (let ((acl2::__function__ 'pedersen-scalar-loop)) (declare (ignorable acl2::__function__)) (if (consp segment) (+ (* (pedersen-enc (take 4 segment)) (expt 2 (* 5 w))) (pedersen-scalar-loop (1+ w) (nthcdr 4 segment))) 0)))
Theorem:
(defthm integerp-of-pedersen-scalar-loop (implies (and (natp w) (bit-listp segment)) (b* ((i (pedersen-scalar-loop w segment))) (integerp i))) :rule-classes :rewrite)
Function:
(defun pedersen-scalar (segment) (declare (xargs :guard (bit-listp segment))) (declare (xargs :guard (integerp (/ (len segment) 4)))) (let ((acl2::__function__ 'pedersen-scalar)) (declare (ignorable acl2::__function__)) (pedersen-scalar-loop 0 segment)))
Theorem:
(defthm integerp-of-pedersen-scalar (implies (bit-listp segment) (b* ((i (pedersen-scalar segment))) (integerp i))) :rule-classes :rewrite)