The stretching of the human-readable portion.
(bech32-hrp-expand s) → expanded-hrp
The
Function:
(defun bech32-hrp-expand (s) (declare (xargs :guard (stringp s))) (let ((__function__ 'bech32-hrp-expand)) (declare (ignorable __function__)) (b* ((char-codes (string=>nats s)) (high-bit-codes (bech32-collect-high-3-bits char-codes)) (low-bit-codes (bech32-collect-low-5-bits char-codes))) (append high-bit-codes '(0) low-bit-codes))))
Theorem:
(defthm return-type-of-bech32-hrp-expand (implies (and (warrant bvshr) (warrant bvand)) (b* ((expanded-hrp (bech32-hrp-expand s))) (unsigned-byte-listp 8 expanded-hrp))) :rule-classes :rewrite)