• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
          • Sha-2
          • Keccak
          • Kdf
          • Mimc
          • Padding
          • Hmac
          • Elliptic-curves
            • Secp256k1-attachment
            • Twisted-edwards
            • Montgomery
              • Montgomery-mul
              • Montgomery-add
              • Montgomery-point-orderp
              • Montgomery-add-commutativity
              • Montgomery-mul-distributivity-over-scalar-addition
              • Montgomery-add-associativity
              • Birational-montgomery-twisted-edwards
              • Montgomery-curve
              • Montgomery-mul-nonneg
              • Montgomery-not-point-with-x-minus1-when-a-minus-2-over-b-not-square
              • Point-on-montgomery-p
                • Montgomery-neg
                • Montgomery-sub
                • Montgomery-add-closure
                • Montgomery-only-point-with-y-0-when-aa-minus-4-non-square
                • Montgomery-point-order-leastp
                • Montgomery-distinct-x-when-nonzero-mul-in-order-range
                • Montgomery-add-inverse-uniqueness
                • Montgomery-distributivity-of-neg-over-add
                • Montgomery-mul-associativity
                • Montgomery-points-with-same-x-have-same-or-neg-y
                • Montgomery-zero
                • Montgomery-points-with-same-x-are-same-or-neg-point
                • Montgomery-mul-of-mod-order
                • Montgomery-neg-inverse
                • Montgomery-zero-identity
                • Point-on-montgomery-finite-when-not-zero
              • Short-weierstrass-curves
              • Birational-montgomery-twisted-edwards
              • Has-square-root?-satisfies-pfield-squarep
              • Secp256k1
              • Secp256k1-domain-parameters
              • Secp256k1-types
              • Pfield-squarep
              • Secp256k1-interface
              • Prime-field-extra-rules
              • Points
            • 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
    • Montgomery

    Point-on-montgomery-p

    Check if a point is on a Montgomery curve.

    Signature
    (point-on-montgomery-p point curve) → yes/no
    Arguments
    point — Guard (pointp point).
    curve — Guard (montgomery-curvep curve).
    Returns
    yes/no — Type (booleanp yes/no).

    The primality requirement in the guard of this function is not strictly needed to define this function, but in general we should only deal with well-formed curves. In particular, curves whose p is prime.

    The point at infinity is on the cure. A finite point (x, y) is on the curve if and only if its components satisfy the curve equation; we require its components to be below the prime, i.e. that the point is in the cartesian product of the prime field.

    Definitions and Theorems

    Function: point-on-montgomery-p

    (defun point-on-montgomery-p (point curve)
      (declare (xargs :guard (and (pointp point)
                                  (montgomery-curvep curve))))
      (let ((acl2::__function__ 'point-on-montgomery-p))
        (declare (ignorable acl2::__function__))
        (b* ((p (montgomery-curve->p curve))
             (a (montgomery-curve->a curve))
             (b (montgomery-curve->b curve))
             ((when (eq (point-kind point) :infinite))
              t)
             (x (point-finite->x point))
             (y (point-finite->y point))
             ((unless (< x p)) nil)
             ((unless (< y p)) nil)
             (x^2 (mul x x p))
             (x^3 (mul x x^2 p))
             (y^2 (mul y y p))
             (a.x^2 (mul a x^2 p))
             (b.y^2 (mul b y^2 p))
             (x^3+a.x^2+x (add x^3 (add a.x^2 x p) p)))
          (equal b.y^2 x^3+a.x^2+x))))

    Theorem: booleanp-of-point-on-montgomery-p

    (defthm booleanp-of-point-on-montgomery-p
      (b* ((yes/no (point-on-montgomery-p point curve)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: point-on-montgomery-p-of-point-fix-point

    (defthm point-on-montgomery-p-of-point-fix-point
      (equal (point-on-montgomery-p (point-fix point)
                                    curve)
             (point-on-montgomery-p point curve)))

    Theorem: point-on-montgomery-p-point-equiv-congruence-on-point

    (defthm point-on-montgomery-p-point-equiv-congruence-on-point
      (implies (point-equiv point point-equiv)
               (equal (point-on-montgomery-p point curve)
                      (point-on-montgomery-p point-equiv curve)))
      :rule-classes :congruence)

    Theorem: point-on-montgomery-p-of-montgomery-curve-fix-curve

    (defthm point-on-montgomery-p-of-montgomery-curve-fix-curve
      (equal (point-on-montgomery-p point (montgomery-curve-fix curve))
             (point-on-montgomery-p point curve)))

    Theorem: point-on-montgomery-p-montgomery-curve-equiv-congruence-on-curve

    (defthm
       point-on-montgomery-p-montgomery-curve-equiv-congruence-on-curve
      (implies (montgomery-curve-equiv curve curve-equiv)
               (equal (point-on-montgomery-p point curve)
                      (point-on-montgomery-p point curve-equiv)))
      :rule-classes :congruence)