The function
(find-group-hash d m) → point?
Since we need to append a byte to the message input, we need to diminish its maximum size by one in the guard.
Function:
(defun find-group-hash-loop (i d m) (declare (xargs :guard (and (natp i) (byte-listp d) (byte-listp m)))) (declare (xargs :guard (and (= (len d) 8) (< (len m) (- blake::*blake2s-max-data-byte-length* 129))))) (let ((__function__ 'find-group-hash-loop)) (declare (ignorable __function__)) (if (mbt (natp i)) (if (< i 256) (b* ((point? (group-hash d (append m (list i))))) (or point? (find-group-hash-loop (1+ i) d m))) nil) (acl2::impossible))))
Theorem:
(defthm maybe-jubjub-pointp-of-find-group-hash-loop (b* ((point? (find-group-hash-loop i d m))) (maybe-jubjub-pointp point?)) :rule-classes :rewrite)
Function:
(defun find-group-hash (d m) (declare (xargs :guard (and (byte-listp d) (byte-listp m)))) (declare (xargs :guard (and (= (len d) 8) (< (len m) (- blake::*blake2s-max-data-byte-length* 129))))) (let ((__function__ 'find-group-hash)) (declare (ignorable __function__)) (find-group-hash-loop 0 d m)))
Theorem:
(defthm maybe-jubjub-pointp-of-find-group-hash (b* ((point? (find-group-hash d m))) (maybe-jubjub-pointp point?)) :rule-classes :rewrite)