• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
        • Bip32
        • Bech32
        • Bip39
          • *bip39-english-words*
          • Bip39-mnemonic-to-seed
          • Bip39-entropy-to-word-indexes
          • Bip39-entropy
          • Bip39-word-indexes-to-words
          • Bip39-words-to-mnemonic
          • Bip39-entropy-to-seed
            • Bip39-entropy-to-mnemonic
            • Bip39-english-words-bound-p
            • Bip39-entropy-size-p
          • Bip44
          • Base58
          • Bip43
          • Bytes
          • Base58check
          • Cryptography
          • Bip-350
          • Bip-173
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bip39

    Bip39-entropy-to-seed

    Turn an entropy value into a seed.

    Signature
    (bip39-entropy-to-seed entropy passphrase) → seed
    Arguments
    entropy — Guard (bip39-entropyp entropy).
    passphrase — Guard (stringp passphrase).
    Returns
    seed — Type (byte-listp seed).

    This combines bip39-entropy-to-mnemonic and bip39-mnemonic-to-seed.

    The limit on the passphrase is the same as in bip39-mnemonic-to-seed. The mnemonic is always below the limit in bip39-mnemonic-to-seed: see the upper bound theorem for bip39-entropy-to-mnemonic.

    Definitions and Theorems

    Function: bip39-entropy-to-seed

    (defun bip39-entropy-to-seed (entropy passphrase)
      (declare (xargs :guard (and (bip39-entropyp entropy)
                                  (stringp passphrase))))
      (declare (xargs :guard (< (length passphrase)
                                (- (expt 2 125) (+ 128 4 8)))))
      (b* ((mnemonic (bip39-entropy-to-mnemonic entropy))
           (seed (bip39-mnemonic-to-seed mnemonic passphrase)))
        seed))

    Theorem: byte-listp-of-bip39-entropy-to-seed

    (defthm byte-listp-of-bip39-entropy-to-seed
      (b* ((seed (bip39-entropy-to-seed entropy passphrase)))
        (byte-listp seed))
      :rule-classes :rewrite)

    Theorem: len-of-bip39-entropy-to-seed

    (defthm len-of-bip39-entropy-to-seed
      (equal (len (bip39-entropy-to-seed entropy passphrase))
             64))

    Theorem: bip39-entropy-to-seed-of-bip39-entropy-fix-entropy

    (defthm bip39-entropy-to-seed-of-bip39-entropy-fix-entropy
      (equal (bip39-entropy-to-seed (bip39-entropy-fix entropy)
                                    passphrase)
             (bip39-entropy-to-seed entropy passphrase)))

    Theorem: bip39-entropy-to-seed-bip39-entropy-equiv-congruence-on-entropy

    (defthm
        bip39-entropy-to-seed-bip39-entropy-equiv-congruence-on-entropy
      (implies (bip39-entropy-equiv entropy entropy-equiv)
               (equal (bip39-entropy-to-seed entropy passphrase)
                      (bip39-entropy-to-seed entropy-equiv passphrase)))
      :rule-classes :congruence)

    Theorem: bip39-entropy-to-seed-of-str-fix-passphrase

    (defthm bip39-entropy-to-seed-of-str-fix-passphrase
      (equal (bip39-entropy-to-seed entropy (acl2::str-fix passphrase))
             (bip39-entropy-to-seed entropy passphrase)))

    Theorem: bip39-entropy-to-seed-streqv-congruence-on-passphrase

    (defthm bip39-entropy-to-seed-streqv-congruence-on-passphrase
      (implies (acl2::streqv passphrase passphrase-equiv)
               (equal (bip39-entropy-to-seed entropy passphrase)
                      (bip39-entropy-to-seed entropy passphrase-equiv)))
      :rule-classes :congruence)