• 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
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
        • Poseidon-main-definition
        • Poseidon-instantiations
          • Poseidon-ingonyama-bls-255-neptune
          • Poseidon-ingonyama-bls-255
          • Poseidon-ingonyama-bn-254
          • Poseidon-rate-8-alpha-17
          • Poseidon-rate-4-alpha-17
            • Hash4-many
            • Hash4
              • Rate-4-alpha-17-parameters
              • Rate-4-domain-fe
            • Poseidon-rate-2-alpha-17
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Poseidon-rate-4-alpha-17

    Hash4

    Hash any reasonable number of inputs to a single field output using RATE=4

    Signature
    (hash4 inputs) → output
    Arguments
    inputs — Guard (fe-listp inputs primes::*bls12-377-scalar-field-prime*).
    Returns
    output — Type (fep output primes::*bls12-377-scalar-field-prime*).

    The inputs and output are field elements.

    This interface function prepends a domain-separation field element and a remaining input-length field element, and then calls the main hash function with an output count of 1.

    The number of inputs must be less than the field size.

    Definitions and Theorems

    Function: hash4

    (defun hash4 (inputs)
     (declare
       (xargs :guard (fe-listp inputs
                               primes::*bls12-377-scalar-field-prime*)))
     (declare
          (xargs :guard (fep (len inputs)
                             primes::*bls12-377-scalar-field-prime*)))
     (let ((__function__ 'hash4))
       (declare (ignorable __function__))
       (first (hash4-many inputs 1))))

    Theorem: fep-of-hash4

    (defthm fep-of-hash4
      (b* ((output (hash4 inputs)))
        (fep output
             primes::*bls12-377-scalar-field-prime*))
      :rule-classes :rewrite)