Child key derivation from parent key.
(bip32-ckd parent i) → (mv error? child)
This is the sum of bip32-ckd-priv and bip32-ckd-pub. It maps (extended) parent private keys to (extended) child private keys and (extended) parent public keys to (extended) child public keys. This function does not appear in [BIP32].
Function:
(defun bip32-ckd (parent i) (declare (xargs :guard (and (bip32-ext-key-p parent) (ubyte32p i)))) (bip32-ext-key-case parent :priv (b* (((mv error? child) (bip32-ckd-priv parent.get i))) (mv error? (bip32-ext-key-priv child))) :pub (b* (((mv error? child) (bip32-ckd-pub parent.get i))) (mv error? (bip32-ext-key-pub child)))))
Theorem:
(defthm booleanp-of-bip32-ckd.error? (b* (((mv ?error? ?child) (bip32-ckd parent i))) (booleanp error?)) :rule-classes :rewrite)
Theorem:
(defthm bip32-ext-key-p-of-bip32-ckd.child (b* (((mv ?error? ?child) (bip32-ckd parent i))) (bip32-ext-key-p child)) :rule-classes :rewrite)
Theorem:
(defthm bip32-ext-key-kind-of-bip32-ckd (equal (bip32-ext-key-kind (mv-nth 1 (bip32-ckd parent i))) (bip32-ext-key-kind parent)))
Theorem:
(defthm bip32-ckd-of-bip32-ext-key-fix-parent (equal (bip32-ckd (bip32-ext-key-fix parent) i) (bip32-ckd parent i)))
Theorem:
(defthm bip32-ckd-bip32-ext-key-equiv-congruence-on-parent (implies (bip32-ext-key-equiv parent parent-equiv) (equal (bip32-ckd parent i) (bip32-ckd parent-equiv i))) :rule-classes :congruence)
Theorem:
(defthm bip32-ckd-of-ubyte32-fix-i (equal (bip32-ckd parent (ubyte32-fix i)) (bip32-ckd parent i)))
Theorem:
(defthm bip32-ckd-ubyte32-equiv-congruence-on-i (implies (acl2::ubyte32-equiv i i-equiv) (equal (bip32-ckd parent i) (bip32-ckd parent i-equiv))) :rule-classes :congruence)