• 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
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
        • R1cs
        • Interfaces
          • Definterface-hmac
          • Definterface-encrypt-block
          • Definterface-hash
          • Definterface-encrypt-init
          • Definterface-pbkdf2
          • Aes-256-cbc-pkcs7-interface
          • Aes-192-cbc-pkcs7-interface
          • Aes-128-cbc-pkcs7-interface
          • Aes-256-interface
          • Aes-192-interface
          • Aes-128-interface
          • Pbkdf2-hmac-sha-512-interface
          • Keccak-256-interface
          • Sha-256-interface
          • Keccak-512-interface
          • Ripemd-160-interface
          • Sha-512-interface
          • Pbkdf2-hmac-sha-256-interface
          • Hmac-sha-512-interface
          • Hmac-sha-256-interface
            • Secp256k1-interface
            • Secp256k1-ecdsa-interface
          • Sha-2
          • Keccak
          • Kdf
          • Mimc
          • Padding
          • Hmac
          • Elliptic-curves
          • Attachments
          • Primes
          • Elliptic-curve-digital-signature-algorithm
        • 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
    • Interfaces

    Hmac-sha-256-interface

    HMAC-SHA-256 interface.

    We instantiate HMAC with the SHA-256 hash, whose block size is 64 bytes according to FIPS 180-4.

    Definitions and Theorems

    Theorem: byte-list-of-hmac-sha-256

    (defthm byte-list-of-hmac-sha-256
      (byte-listp (hmac-sha-256 key text)))

    Theorem: len-of-hmac-sha-256

    (defthm len-of-hmac-sha-256
      (equal (len (hmac-sha-256 key text))
             32))

    Theorem: hmac-sha-256-of-byte-list-fix-key

    (defthm hmac-sha-256-of-byte-list-fix-key
      (equal (hmac-sha-256 (byte-list-fix key) text)
             (hmac-sha-256 key text)))

    Theorem: hmac-sha-256-byte-list-equiv-congruence-on-key

    (defthm hmac-sha-256-byte-list-equiv-congruence-on-key
      (implies (byte-list-equiv key key-equiv)
               (equal (hmac-sha-256 key text)
                      (hmac-sha-256 key-equiv text)))
      :rule-classes :congruence)

    Theorem: hmac-sha-256-of-byte-list-fix-text

    (defthm hmac-sha-256-of-byte-list-fix-text
      (equal (hmac-sha-256 key (byte-list-fix text))
             (hmac-sha-256 key text)))

    Theorem: hmac-sha-256-byte-list-equiv-congruence-on-text

    (defthm hmac-sha-256-byte-list-equiv-congruence-on-text
      (implies (byte-list-equiv text text-equiv)
               (equal (hmac-sha-256 key text)
                      (hmac-sha-256 key text-equiv)))
      :rule-classes :congruence)

    Theorem: true-listp-of-hmac-sha-256

    (defthm true-listp-of-hmac-sha-256
      (true-listp (hmac-sha-256 key text))
      :rule-classes :type-prescription)

    Theorem: consp-of-hmac-sha-256

    (defthm consp-of-hmac-sha-256
      (consp (hmac-sha-256 key text))
      :rule-classes :type-prescription)

    Theorem: byte-list32p-of-hmac-sha-256

    (defthm byte-list32p-of-hmac-sha-256
      (byte-list32p (hmac-sha-256 key text)))