• 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
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                • Dynamic-environments
                • Arithmetic-operations
                  • Integer-arithmetic-operations
                  • Field-arithmetic-operations
                    • Op-field-pow
                    • Op-field-sub
                    • Op-field-mul
                    • Op-field-div
                    • Op-field-add
                    • Op-field-square-root
                    • Op-field-square
                    • Op-field-inv
                    • Op-field-double
                    • Op-field-neg
                  • Scalar-field-arithmetic-operations
                  • Group-arithmetic-operations
                  • Op-mul
                  • Op-add
                  • Op-sub-wrapped
                  • Op-sub
                  • Op-rem-wrapped
                  • Op-pow-wrapped
                  • Op-pow
                  • Op-mul-wrapped
                  • Op-div-wrapped
                  • Op-div
                  • Op-add-wrapped
                  • Op-rem
                  • Op-square-root
                  • Op-square
                  • Op-neg
                  • Op-inv
                  • Op-double
                  • Op-abs-wrapped
                  • Op-abs
                • Curve-parameterization
                • Shift-operations
                • Errors
                • Value-expressions
                • Locations
                • Input-execution
                • Edwards-bls12-generator
                • Equality-operations
                • Logical-operations
                • Program-execution
                • Ordering-operations
                • Bitwise-operations
                • Literal-evaluation
                • Type-maps-for-struct-components
                • Output-execution
                • Tuple-operations
                • Struct-operations
              • Compilation
              • Static-semantics
              • Concrete-syntax
      • Bigmems
      • Builtins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Arithmetic-operations

Field-arithmetic-operations

Leo field arithmetic operations.

These are negation (unary), doubling (unary), inverse (unary), square (unary), addition, subtraction, multiplication, division, and exponentiation (all binary).

These ACL2 functions are defined over values of the value-field type value-field type. These values contain natural numbers that are not guaranteed to be below the prime returned by (curve-base-prime curve). It should be an invariant (to be formally proved eventually) that, given a prime number used in Leo computation steps, Leo computation states will have field element values below the prime. The ACL2 functions defined below defensively check that this is the case, returning an indication of error if not.

Subtopics

Op-field-pow
Leo field exponentiation operation.
Op-field-sub
Leo field subtraction operation.
Op-field-mul
Leo field multiplication operation.
Op-field-div
Leo field division operation.
Op-field-add
Leo field addition operation.
Op-field-square-root
Leo field square-root operation.
Op-field-square
Leo field squaring operation.
Op-field-inv
Leo field inverse (reciprocal) operation.
Op-field-double
Leo field double operation.
Op-field-neg
Leo field negation operation.