• 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

    Find-group-hash

    The function \mathsf{FindGroupHash^{\mathbb{J}^{(r)*}}} [ZPS:5.4.9.5].

    Signature
    (find-group-hash d m) → point?
    Arguments
    d — Guard (byte-listp d).
    m — Guard (byte-listp m).
    Returns
    point? — Type (maybe-jubjub-pointp point?).

    Since we need to append a byte to the message input, we need to diminish its maximum size by one in the guard.

    Definitions and Theorems

    Function: find-group-hash-loop

    (defun find-group-hash-loop (i d m)
     (declare (xargs :guard (and (natp i)
                                 (byte-listp d)
                                 (byte-listp m))))
     (declare (xargs :guard (and (= (len d) 8)
                                 (<= (len m)
                                     (- blake::*max-input-bytes* 65)))))
     (let ((__function__ 'find-group-hash-loop))
       (declare (ignorable __function__))
       (if (mbt (natp i))
           (if (< i 256)
               (b* ((point? (group-hash d (append m (list i)))))
                 (or point?
                     (find-group-hash-loop (1+ i) d m)))
             nil)
         (acl2::impossible))))

    Theorem: maybe-jubjub-pointp-of-find-group-hash-loop

    (defthm maybe-jubjub-pointp-of-find-group-hash-loop
      (b* ((point? (find-group-hash-loop i d m)))
        (maybe-jubjub-pointp point?))
      :rule-classes :rewrite)

    Function: find-group-hash

    (defun find-group-hash (d m)
     (declare (xargs :guard (and (byte-listp d) (byte-listp m))))
     (declare (xargs :guard (and (= (len d) 8)
                                 (<= (len m)
                                     (- blake::*max-input-bytes* 65)))))
     (let ((__function__ 'find-group-hash))
       (declare (ignorable __function__))
       (find-group-hash-loop 0 d m)))

    Theorem: maybe-jubjub-pointp-of-find-group-hash

    (defthm maybe-jubjub-pointp-of-find-group-hash
      (b* ((point? (find-group-hash d m)))
        (maybe-jubjub-pointp point?))
      :rule-classes :rewrite)