• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
              • Twisted-edwards-mul
              • Twisted-edwards-mul-fast
              • Twisted-edwards-add
              • Twisted-edwards-point-orderp
              • Twisted-edwards-add-associativity
              • Twisted-edwards-mul-distributivity-over-scalar-addition
              • Twisted-edwards-neg-inverse
              • Twisted-edwards-mul-fast-nonneg
              • Twisted-edwards-curve
                • Twisted-edwards-curve-fix
                • Twisted-edwards-curve-equiv
                • Twisted-edwards-curvep
                • Make-twisted-edwards-curve
                  • Twisted-edwards-curve->p
                  • Change-twisted-edwards-curve
                  • Twisted-edwards-curve->d
                  • Twisted-edwards-curve->a
                • Twisted-edwards-mul-nonneg
                • Birational-montgomery-twisted-edwards
                • Twisted-edwards-compress
                • Twisted-edwards-neg
                • Twisted-edwards-sub
                • Point-on-twisted-edwards-p
                • Twisted-edwards-curve-completep
                • Twisted-edwards-point-order-leastp
                • Twisted-edwards-only-points-with-x-0-or-y-1
                • Twisted-edwards-add-inverse-uniqueness
                • Twisted-edwards-distributivity-of-neg-over-add
                • Twisted-edwards-mul-associativity
                • Twisted-edwards-zero
                • Twisted-edwards-add-closure
                • Twisted-edwards-point-orderp-of-neg
                • Twisted-edwards-mul-of-mod-order
                • Twisted-edwards-zero-identity
                • Twisted-edwards-add-cancel-left
                • Twisted-edwards-mul-of-neg
                • Twisted-edwards-add-commutative
              • Montgomery
              • 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
    • Twisted-edwards-curve

    Make-twisted-edwards-curve

    Basic constructor macro for twisted-edwards-curve structures.

    Syntax
    (make-twisted-edwards-curve [:p <p>] 
                                [:a <a>] 
                                [:d <d>]) 
    

    This is the usual way to construct twisted-edwards-curve structures. It simply conses together a structure with the specified fields.

    This macro generates a new twisted-edwards-curve structure from scratch. See also change-twisted-edwards-curve, which can "change" an existing structure, instead.

    Definition

    This is an ordinary make- macro introduced by fty::defprod.

    Macro: make-twisted-edwards-curve

    (defmacro make-twisted-edwards-curve (&rest args)
      (std::make-aggregate 'twisted-edwards-curve
                           args '((:p) (:a) (:d))
                           'make-twisted-edwards-curve
                           nil))

    Function: twisted-edwards-curve

    (defun twisted-edwards-curve (p a d)
      (declare (xargs :guard (natp p)))
      (declare (xargs :guard (and (dm::primep p)
                                  (> p 2)
                                  (fep a p)
                                  (fep d p)
                                  (not (equal a d))
                                  (not (equal a 0))
                                  (not (equal d 0)))))
      (let ((acl2::__function__ 'twisted-edwards-curve))
        (declare (ignorable acl2::__function__))
        (b* ((p (mbe :logic (nfix p) :exec p)))
          (let ((p (mbe :logic (if (and (dm::primep p) (> p 2)) p 3)
                        :exec p))
                (a (mbe :logic
                        (if (and (dm::primep p)
                                 (> p 2)
                                 (fep a p)
                                 (fep d p)
                                 (not (equal a d))
                                 (not (equal a 0))
                                 (not (equal d 0)))
                            a
                          1)
                        :exec a))
                (d (mbe :logic
                        (if (and (dm::primep p)
                                 (> p 2)
                                 (fep a p)
                                 (fep d p)
                                 (not (equal a d))
                                 (not (equal a 0))
                                 (not (equal d 0)))
                            d
                          2)
                        :exec d)))
            (list (cons 'p p)
                  (cons 'a a)
                  (cons 'd d))))))