• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • 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
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • 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
            • Elliptic-curve-digital-signature-algorithm
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Interfaces

    Keccak-256-interface

    Keccak-256 interface.

    Keccak-256 is specified in the Keccak web site, in particular `The Keccak Reference' document, Version 3.0.

    According to the aforementioned specification, the input of Keccak-256 is a sequence of any number of bits, or any number of bytes.

    According to the aforementioned specification, the output of Keccak-256 is a sequence of exactly 256 bits, or 32 bytes.

    See also:

    • Keccak-256 executable specification
    • attaching Keccak-256 executable specification to this interface

    Definitions and Theorems

    Theorem: bit-list-of-keccak-256-bits

    (defthm bit-list-of-keccak-256-bits
      (bit-listp (keccak-256-bits bits)))

    Theorem: byte-list-of-keccak-256-bytes

    (defthm byte-list-of-keccak-256-bytes
      (byte-listp (keccak-256-bytes bytes)))

    Theorem: len-of-keccak-256-bits

    (defthm len-of-keccak-256-bits
      (equal (len (keccak-256-bits bits))
             256))

    Theorem: len-of-keccak-256-bytes

    (defthm len-of-keccak-256-bytes
      (equal (len (keccak-256-bytes bytes))
             32))

    Theorem: keccak-256-bits-of-bit-list-fix-bits

    (defthm keccak-256-bits-of-bit-list-fix-bits
      (equal (keccak-256-bits (acl2::bit-list-fix bits))
             (keccak-256-bits bits)))

    Theorem: keccak-256-bits-bit-list-equiv-congruence-on-bits

    (defthm keccak-256-bits-bit-list-equiv-congruence-on-bits
      (implies (acl2::bit-list-equiv bits bits-equiv)
               (equal (keccak-256-bits bits)
                      (keccak-256-bits bits-equiv)))
      :rule-classes :congruence)

    Theorem: keccak-256-bytes-of-byte-list-fix-bytes

    (defthm keccak-256-bytes-of-byte-list-fix-bytes
      (equal (keccak-256-bytes (byte-list-fix bytes))
             (keccak-256-bytes bytes)))

    Theorem: keccak-256-bytes-byte-list-equiv-congruence-on-bytes

    (defthm keccak-256-bytes-byte-list-equiv-congruence-on-bytes
      (implies (byte-list-equiv bytes bytes-equiv)
               (equal (keccak-256-bytes bytes)
                      (keccak-256-bytes bytes-equiv)))
      :rule-classes :congruence)

    Theorem: true-listp-of-keccak-256-bits

    (defthm true-listp-of-keccak-256-bits
      (true-listp (keccak-256-bits bits))
      :rule-classes :type-prescription)

    Theorem: true-listp-of-keccak-256-bytes

    (defthm true-listp-of-keccak-256-bytes
      (true-listp (keccak-256-bytes bytes))
      :rule-classes :type-prescription)

    Theorem: consp-of-keccak-256-bits

    (defthm consp-of-keccak-256-bits
      (consp (keccak-256-bits bits))
      :rule-classes :type-prescription)

    Theorem: consp-of-keccak-256-bytes

    (defthm consp-of-keccak-256-bytes
      (consp (keccak-256-bytes bytes))
      :rule-classes :type-prescription)

    Theorem: byte-list32p-of-keccak-256-bytes

    (defthm byte-list32p-of-keccak-256-bytes
      (byte-list32p (keccak-256-bytes bytes)))