• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
        • R1cs
        • Interfaces
        • Sha-2
        • Keccak
        • Kdf
        • Mimc
        • Padding
        • Hmac
        • Elliptic-curves
          • Secp256k1-attachment
          • Twisted-edwards
          • Montgomery
          • Short-weierstrass-curves
            • Short-weierstrass
              • Short-weierstrass-fix
              • Short-weierstrass-equiv
              • Make-short-weierstrass
                • Curve-scalar-*
                • Short-weierstrass->p
                • Short-weierstrass->b
                • Short-weierstrass->a
                • Curve-group-+
                • Change-short-weierstrass
                • Short-weierstrass-p
                • Point-on-weierstrass-elliptic-curve-p
                • Curve-negate
                • Weierstrass-elliptic-curve-p
              • Short-weierstrass-primep
            • 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
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Short-weierstrass

    Make-short-weierstrass

    Basic constructor macro for short-weierstrass structures.

    Syntax
    (make-short-weierstrass [:p <p>] 
                            [:a <a>] 
                            [:b <b>]) 
    

    This is the usual way to construct short-weierstrass structures. It simply conses together a structure with the specified fields.

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

    Definition

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

    Macro: make-short-weierstrass

    (defmacro make-short-weierstrass (&rest args)
      (std::make-aggregate 'short-weierstrass
                           args '((:p) (:a) (:b))
                           'make-short-weierstrass
                           nil))

    Function: short-weierstrass

    (defun short-weierstrass (p a b)
     (declare (xargs :guard (and (natp p) (natp a) (natp b))))
     (declare
         (xargs :guard (and (> p 3)
                            (fep a p)
                            (fep b p)
                            (posp (mod (+ (* 4 a a a) (* 27 b b)) p)))))
     (let ((acl2::__function__ 'short-weierstrass))
      (declare (ignorable acl2::__function__))
      (b* ((p (mbe :logic (nfix p) :exec p))
           (a (mbe :logic (nfix a) :exec a))
           (b (mbe :logic (nfix b) :exec b)))
       (let ((p (mbe :logic
                     (if (and (> p 3)
                              (fep a p)
                              (fep b p)
                              (posp (mod (+ (* 4 a a a) (* 27 b b)) p)))
                         p
                       5)
                     :exec p))
             (a (mbe :logic
                     (if (and (> p 3)
                              (fep a p)
                              (fep b p)
                              (posp (mod (+ (* 4 a a a) (* 27 b b)) p)))
                         a
                       0)
                     :exec a))
             (b (mbe :logic
                     (if (and (> p 3)
                              (fep a p)
                              (fep b p)
                              (posp (mod (+ (* 4 a a a) (* 27 b b)) p)))
                         b
                       1)
                     :exec b)))
         (list (cons 'p p)
               (cons 'a a)
               (cons 'b b))))))