Fixer for bip32-chain-code.
(bip32-chain-code-fix x) → fixed-x
Function:
(defun bip32-chain-code-fix (x) (declare (xargs :guard (bip32-chain-code-p x))) (mbe :logic (if (bip32-chain-code-p x) x (repeat 32 0)) :exec x))
Theorem:
(defthm bip32-chain-code-p-of-bip32-chain-code-fix (b* ((fixed-x (bip32-chain-code-fix x))) (bip32-chain-code-p fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm bip32-chain-code-fix-when-bip32-chain-code-p (implies (bip32-chain-code-p x) (equal (bip32-chain-code-fix x) x)))