Git Product home page Git Product logo

Comments (2)

mcarrickscott avatar mcarrickscott commented on July 21, 2024

Not sure this is a problem. That 1A01111...AAB is the modulus p. The library uses lazy reduction, and field elements need to be fully reduced wrt the modulus before being compared. After reduction the 1A01111...AAB becomes 0 mod p. The fact that it happens in such a simple case is I suspect an artifact that arises from Montgomery reduction, where here we lazily do not perform the "final subtraction".

from core.

blynn avatar blynn commented on July 21, 2024

Thanks! So it's not a normalization problem at all and I should call reduce() before serialization if I want the element in a canonical form (just as equals() does internally).

For the applications I have in mind, I'd prefer if tobytes() and tostring() always called reduce() implicitly, but I suppose there may be some applications where the existing behaviour is better.

from core.

Related Issues (20)

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.