Giter Site home page Giter Site logo

Comments (2)

ThomasPiellard avatar ThomasPiellard commented on July 20, 2024

Hi @holiman , so the scalar that you have is in fact a multiple of r, the group order of bls12-381. So the result of the scalar multiplication is the point at infinity, encoded as [0,0]. gnark-crypto and geth use a different encoding for the point at infinity in affine, for geth it's [0,0], for gnark-crypto it's 0x40 << 760, so it's indeed bigger than bls12-381's field of definition. The reason for our way of serializing is to match ZCash and IETF encoding.

from gnark-crypto.

gbotrel avatar gbotrel commented on July 20, 2024

To give more context on this one;

  1. We did investigate and found no bug on our side related to either the ScalarMul or the [de]serialization.
  2. As for the encoding differences, we follow the latest IETF draft, and Ethereum 2.0 (through the use of supranational/blst) does too. In particular:
The most-significant three bits of a G1 or G2 encoding should be masked away before the coordinate(s) are interpreted. These bits are used to unambiguously represent the underlying element:

...
The second-most significant bit indicates that the point is at infinity. If this bit is set, the remaining bits of the group element's encoding should be set to zero.

from gnark-crypto.

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.