• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Java
        • C
        • Syntheto
        • Number-theory
        • Cryptography
          • R1cs
          • Interfaces
          • Sha-2
          • Keccak
          • Kdf
            • Mimc
            • Padding
            • Hmac
            • Elliptic-curves
            • Attachments
            • Elliptic-curve-digital-signature-algorithm
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • 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.