• 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
        • Mmp-trees
        • Semaphore
          • Verify-semaphore-r1cs
          • Mimc
          • Semaphore-specification
            • Prime-field-abbreviations
            • Pedersen-hash
              • Pedersen-scalar
              • Pedersen-generator
              • Pedersen-enc
              • Pedersen-pad
              • Pedersen
                • Pedersen-addend
              • Pedersen-hash-base-points
              • Baby-jubjub
            • Semaphore-proofs
          • Database
          • Cryptography
          • Rlp
          • Transactions
          • Hex-prefix
          • Basics
          • Addresses
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • 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
    • Pedersen-hash

    Pedersen

    Point resulting from the Pedersen hash.

    Signature
    (pedersen m) → hash
    Arguments
    m — Guard (bit-listp m).
    Returns
    hash — Type (baby-jubjub-pointp hash).

    We pad the message if needed, and then we go through each segment and add the addend points together.

    Definitions and Theorems

    Function: pedersen-loop

    (defun pedersen-loop (i m)
      (declare (xargs :guard (and (natp i) (bit-listp m))))
      (declare (xargs :guard (integerp (/ (len m) 4))))
      (let ((acl2::__function__ 'pedersen-loop))
        (declare (ignorable acl2::__function__))
        (b* (((when (<= (len m) 200))
              (pedersen-addend m i))
             (point1 (pedersen-addend (take 200 m) i))
             (point2 (pedersen-loop (1+ i) (nthcdr 200 m))))
          (baby-jubjub-add point1 point2))))

    Theorem: baby-jubjub-pointp-of-pedersen-loop

    (defthm baby-jubjub-pointp-of-pedersen-loop
      (b* ((point (pedersen-loop i m)))
        (baby-jubjub-pointp point))
      :rule-classes :rewrite)

    Function: pedersen

    (defun pedersen (m)
      (declare (xargs :guard (bit-listp m)))
      (let ((acl2::__function__ 'pedersen))
        (declare (ignorable acl2::__function__))
        (b* ((m1 (pedersen-pad m)))
          (pedersen-loop 0 m1))))

    Theorem: baby-jubjub-pointp-of-pedersen

    (defthm baby-jubjub-pointp-of-pedersen
      (b* ((hash (pedersen m)))
        (baby-jubjub-pointp hash))
      :rule-classes :rewrite)