• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
          • Bip32
            • Bip32-wallet-structure
            • Bip32-key-trees
            • Bip32-key-serialization
            • Bip32-key-derivation
            • Bip32-executable-attachments
            • Bip32-extended-keys
              • Bip32-chain-code
                • Bip32-chain-code-p
                • Bip32-chain-code-fix
                • Bip32-ext-pub-key
                • Bip32-ext-priv-key
                • Bip32-ext-key
              • Bip32-master-key-generation
            • Bech32
            • Bip39
            • Bip44
            • Base58
            • Bip43
            • Bytes
            • Base58check
            • Cryptography
            • Bip-350
            • Bip-173
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Bip32-chain-code

    Bip32-chain-code-fix

    Fixer for bip32-chain-code.

    Signature
    (bip32-chain-code-fix x) → fixed-x
    Arguments
    x — Guard (bip32-chain-code-p x).
    Returns
    fixed-x — Type (bip32-chain-code-p fixed-x).

    Definitions and Theorems

    Function: bip32-chain-code-fix

    (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: bip32-chain-code-p-of-bip32-chain-code-fix

    (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: bip32-chain-code-fix-when-bip32-chain-code-p

    (defthm bip32-chain-code-fix-when-bip32-chain-code-p
      (implies (bip32-chain-code-p x)
               (equal (bip32-chain-code-fix x) x)))