Giter Club home page Giter Club logo

Comments (2)

NikZak avatar NikZak commented on June 19, 2024

and Fr_pow

from circom-witness-rs.

biscuitdey avatar biscuitdey commented on June 19, 2024

@NikZak

A.
To extend the eval functions, we can do the following using ruint library:

  1. Fr_neg --> Neg => (M - a) assuming M is the field's order. This has been used to calculate Sub
  2. Fr_div --> Div => a.mul_mod (b.inv_mod(M), M) use inv_mod from ruint::algorithms as this uses Extended Euclidean Algorithm to calculate the inverse.
  3. Fr_pow --> Pow => a.pow_mod(b, M)

B.
To extend the eval_fr functions, we can do the following:
The Prime Field Fr = Fp256<MontBackend<FrConfig, 4>> elements are implemented using the ark_ff library, which provides functions for calculating negative, division, etc. Adding the following code to the graph.rs file, under the impl Operation -> eval_fr might work :

Neg => a.neg_in_place(),
FromString => Fr::from_str("testString"),
Div => a / b

Source:

  1. Ark prime fields library : ark_ff
  2. Ark BN254 curve example (similar to ark_bn254 curve used) : curve
  3. Arkworks-rs guide
  4. Arkworks-rs github

from circom-witness-rs.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.