• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Community
    • 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
            • Short-weierstrass-curves
            • Birational-montgomery-twisted-edwards
            • Has-square-root?-satisfies-pfield-squarep
            • Secp256k1
            • Secp256k1-domain-parameters
            • Secp256k1-types
              • Secp256k1-priv-key
              • Secp256k1-pub-key
              • Secp256k1-field
                • Secp256k1-fieldp
                • Secp256k1-field-fix
                • Secp256k1-point
                • Secp256k1-point-to-bytes
                • Secp256k1-point-infinityp
                • Secp256k1-point-generator
              • 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
    • Secp256k1-field

    Secp256k1-field-fix

    Fixer for secp256k1-field.

    Signature
    (secp256k1-field-fix x) → fixed-x
    Arguments
    x — Guard (secp256k1-fieldp x).
    Returns
    fixed-x — Type (secp256k1-fieldp fixed-x).

    Definitions and Theorems

    Function: secp256k1-field-fix

    (defun secp256k1-field-fix (x)
      (declare (xargs :guard (secp256k1-fieldp x)))
      (mbe :logic (if (secp256k1-fieldp x) x 0)
           :exec x))

    Theorem: secp256k1-fieldp-of-secp256k1-field-fix

    (defthm secp256k1-fieldp-of-secp256k1-field-fix
      (b* ((fixed-x (secp256k1-field-fix x)))
        (secp256k1-fieldp fixed-x))
      :rule-classes :rewrite)

    Theorem: secp256k1-field-fix-when-secp256k1-fieldp

    (defthm secp256k1-field-fix-when-secp256k1-fieldp
      (implies (secp256k1-fieldp x)
               (equal (secp256k1-field-fix x) x)))