• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
        • R1cs
        • Interfaces
        • Sha-2
        • Keccak
        • Kdf
          • Mimc
          • Padding
          • Hmac
          • Elliptic-curves
          • Attachments
          • Elliptic-curve-digital-signature-algorithm
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Cryptography

    Kdf

    A library for Key Derivation Functions

    The KDF library includes a formal specification for PBKDF2, Password-Based Key Derivation Function 2, specialized to use the pseudorandom function HMAC-SHA-512. This key derivation function is defined in IETF RFC 8018

    The following include-book command may be helpful to bring in the library:

    (include-book "kestrel/crypto/kdf/pbkdf2-hmac-sha-512" :dir :system)

    Interface Functions

    pbkdf2-hmac-sha-512

    (pbkdf2-hmac-sha-512 p s c dklen)

    Arguments:

    1. P -- the password, an octet string represented as a list of 8-bit bytes
    2. S -- the salt, an octet string represented as a list of 8-bit bytes
    3. c -- the iteraction count. Note that BIP 39 uses an iteraction count of 2048.
    4. dkLen -- the intended length in octets of the derived key. Note that BIP 39 uses a length of 64.

    Returns a list of dkLen bytes.

    pbkdf2-hmac-sha-512-strings

    (pbkdf2-hmac-sha-512-from-strings p-string s-string c dklen)

    Arguments:

    1. P-string -- the password, an octet string represented as an ACL2 string
    2. S-string -- the salt, an octet string represented as a an ACL2 string
    3. c -- the iteraction count. Note that BIP 39 uses an iteraction count of 2048.
    4. dkLen -- the intended length in octets of the derived key. Note that BIP 39 uses a length of 64.

    Returns a list of dkLen bytes.