• 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
          • Jubjub
          • Verify-zcash-r1cs
          • Lift-zcash-r1cs
          • Pedersen-hash
            • Pedersen-segment-scalar
            • Pedersen-segment-point
            • Find-group-hash
            • Pedersen-point
            • Pedersen-enc
            • Group-hash
            • Coordinate-extract
            • Pedersen-segment-addend
            • Pedersen
              • Pedersen-pad
              • Pedersen-hash-injectivity-properties
              • Pedersen-hash-bound-properties
              • Pedersen-hash-image-properties
              • *pedersen-c*
            • Zcash-gadgets
            • Bit/byte/integer-conversions
            • Constants
            • Blake2-hash
            • Randomness-beacon
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Pedersen-hash

    Pedersen

    The function \mathsf{PedersenHash} [ZPS:5.4.1.7].

    Signature
    (pedersen d m) → hash
    Arguments
    d — Guard (byte-listp d).
    m — Guard (bit-listp m).
    Returns
    hash — Type (bit-listp hash).

    We return nil if, instead of a point, an error is returned. This is distinguished from a valid hash, which is not empty.

    Definitions and Theorems

    Function: pedersen

    (defun pedersen (d m)
      (declare (xargs :guard (and (byte-listp d) (bit-listp m))))
      (declare (xargs :guard (and (= (len d) 8) (consp m))))
      (let ((__function__ 'pedersen))
        (declare (ignorable __function__))
        (b* ((point (pedersen-point d m))
             ((unless (jubjub-pointp point)) nil))
          (coordinate-extract point))))

    Theorem: bit-listp-of-pedersen

    (defthm bit-listp-of-pedersen
      (b* ((hash (pedersen d m)))
        (bit-listp hash))
      :rule-classes :rewrite)