• 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
        • 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

    Montgomery-neg

    Negation of a point of the Montgomery curve group.

    Signature
    (montgomery-neg point curve) → point1
    Arguments
    point — Guard (pointp point).
    curve — Guard (montgomery-curvep curve).
    Returns
    point1 — Type (pointp point1).

    This is the inverse with respect to the group addition operation.

    The negation of the point at infinity is the point at infinity. The negation of a finite point is obtained by negating the y coordinate.

    Definitions and Theorems

    Function: montgomery-neg

    (defun montgomery-neg (point curve)
      (declare (xargs :guard (and (pointp point)
                                  (montgomery-curvep curve))))
      (declare (xargs :guard (point-on-montgomery-p point curve)))
      (let ((acl2::__function__ 'montgomery-neg))
        (declare (ignorable acl2::__function__))
        (case (point-kind point)
          (:infinite (point-infinite))
          (:finite (b* ((p (montgomery-curve->p curve))
                        (x (point-finite->x point))
                        (y (point-finite->y point)))
                     (point-finite x (neg y p)))))))

    Theorem: pointp-of-montgomery-neg

    (defthm pointp-of-montgomery-neg
      (b* ((point1 (montgomery-neg point curve)))
        (pointp point1))
      :rule-classes :rewrite)

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

    (defthm point-on-montgomery-p-of-montgomery-neg
      (implies (point-on-montgomery-p point curve)
               (point-on-montgomery-p (montgomery-neg point curve)
                                      curve)))

    Theorem: montgomery-neg-of-zero

    (defthm montgomery-neg-of-zero
      (equal (montgomery-neg (montgomery-zero) curve)
             (montgomery-zero)))

    Theorem: montgomery-neg-of-neg

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

    Theorem: montgomery-neg-of-point-fix-point

    (defthm montgomery-neg-of-point-fix-point
      (equal (montgomery-neg (point-fix point) curve)
             (montgomery-neg point curve)))

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

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

    Theorem: montgomery-neg-of-montgomery-curve-fix-curve

    (defthm montgomery-neg-of-montgomery-curve-fix-curve
      (equal (montgomery-neg point (montgomery-curve-fix curve))
             (montgomery-neg point curve)))

    Theorem: montgomery-neg-montgomery-curve-equiv-congruence-on-curve

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