GithubHelp home page GithubHelp logo

arnaucube / go-blindsecp256k1 Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 5.0 4.81 MB

Blind signatures over secp256k1 elliptic curve

License: GNU General Public License v3.0

Go 93.32% Shell 0.33% HTML 1.13% JavaScript 5.22%

go-blindsecp256k1's People

Contributors

arnaucube avatar p4u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-blindsecp256k1's Issues

wrong check of big.Int bytes size

Looks like this check should be removed or modified:

if len(b.Bytes()) != 32 { //nolint:gomnd

The big.Int type can have less than 32 bytes if the number starts with "0x00" (we've found this issue in a working code)

The following code

    h := "001ec8a5ac7b6f30f24582a1cc7a99714162d9f73d5b5b1d64c3df0b53914320"
    b, _ := hex.DecodeString(h)
    bi := new(big.Int).SetBytes(b)
    fmt.Printf("%s | %x | %d\n", bi.String(), bi.Bytes(), len(bi.Bytes()))

produces this output, thus the big.Int is of 31 bytes (but still válid).

54390227768401831994291737067988167540000774869646691930140901779484787488 | 1ec8a5ac7b6f30f24582a1cc7a99714162d9f73d5b5b1d64c3df0b53914320 | 31

If the signature requires 32 bytes but a big.Int type is used as input, I think the function should build the padding

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.