Giter VIP home page Giter VIP logo

Comments (4)

bford avatar bford commented on June 8, 2024

Sorry I wasn't able to get back to looking at this until now.

The intention of both the Point and Secret interfaces is that you are supposed to set objects of those classes explicitly to something before you try to use them (e.g., in Equal or any other method that reads them). For example, if you want to compare a point P against the neutral element, then you might do P.Equal(suite.Point().Null()), not just P.Equal(suite.Point()). If you want to compare P against the standard base point, you might do P.Equal(suite.Point().Base()). I just committed a change to the documentation for abstract.Group to clarify this requirement; sorry that was left unclear.

It's of course perfectly debatable whether the Point/Secret interfaces should require explicit initialization before use: for example, Go's big.Int does not require initialization before use, such that any uninitialized big.Int defaults to zero. That's convenient, and probably makes sense for general-purpose big.Int calculations. However, since Secret and Point objects are specifically intended for security-critical usage scenarios, in which buggy code that forgets to initialize a Secret or Point to the non-zero value it's supposed to have might very easily "fail open" and look like it's behaving correctly while in fact being completely insecure, it seemed to me that avoiding that security risk of actually having a Secret or Point default to a "null" value seems worth the slight convenience cost of requiring every Secret or Point to be explicitly initialized before use.

Make sense?
B

from kyber.

WEB3-GForce avatar WEB3-GForce commented on June 8, 2024

Thanks, I thought group.Point() and group.Secret() returned initialized objects. I should be able to finish up the testing code now.

As a side note, for the different cryptographic schemes that we have, are there any that will generate a fresh, initialized secret (private key) and a point (public key) from that secret?

from kyber.

bford avatar bford commented on June 8, 2024

On Jan 28, 2015, at 3:31 PM, William Bailey [email protected] wrote:

Thanks, I thought group.Point() and group.Secret() returned initialized objects. I should be able to finish up the testing code now.

As a side note, for the different cryptographic schemes that we have, are there any that will generate a fresh, initialized secret (private key) and a point (public key) from that secret?

Use Secret.Pick() to generate the fresh private key and Point.Mul() to produce its public key. Just grep through the crypto library source code and existing test cases and you’ll find a lot of examples where that is done.

B


Reply to this email directly or view it on GitHub #21 (comment).

from kyber.

WEB3-GForce avatar WEB3-GForce commented on June 8, 2024

Thanks!

from kyber.

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.