Coder Social home page Coder Social logo

kyber-bls12381's Introduction

kyber-bls12381

Kyber wrapper around kilic/bls12381 library.

Note: GT does not fully support the kyber.Point interface yet.

Previous library

This repository is the successor of the previous library bls12381 which was a complete fork of the upstream library.

kyber-bls12381's People

Contributors

anomalroil avatar nikkolasg avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kyber-bls12381's Issues

upgrade github.com/kilic/bls12-381 version ?

cur github.com/kilic/bls12-381 v0.0.0-20200820230200-6b2c19996391

Can it support github.com/kilic/bls12-381 v0.1.0 ?

print /data/user/mods/pkg/mod/github.com/drand/[email protected]/kyber_g1.go:92:50: cannot use &s.(*mod.Int).V (type *big.Int) as type *bls12381.Fr in argument to bls12381.NewG1().MulScalar /data/user/mods/pkg/mod/github.com/drand/[email protected]/kyber_g2.go:97:50: cannot use &s.(*mod.Int).V (type *big.Int) as type *bls12381.Fr in argument to bls12381.NewG2().MulScalar when i exec go build

I found that it was a problem with the github.com/kilic/bls12-381 version!

Are there plans to open source this code?

I noticed that this repo has no LICENSE file, while all other parts of drand are open source. Is this on purpose? If so, are there plans to change at some point?

The same Domain is used for both G1 and G2 Hash()

It appears that we are currently re-using the same domain for both G1 and G2 hash to curve functions:

kyber-bls12381/kyber_g1.go

Lines 135 to 140 in 21249c0

func (k *KyberG1) Hash(m []byte) kyber.Point {
p, _ := bls12381.NewG1().HashToCurve(m, Domain)
k.p = p
return k
}

kyber-bls12381/kyber_g2.go

Lines 140 to 144 in 21249c0

func (k *KyberG2) Hash(m []byte) kyber.Point {
pg2, _ := bls12381.NewG2().HashToCurve(m, Domain)
k.p = pg2
return k
}

with Domain being:

// Domain comes from the ciphersuite used by the RFC of this name compatible
// with the paired library > v18
var Domain = []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_")

This is unfortunate as it makes us non-spec compliant 😢
Security-wise it shouldn't be an issue as long as we are not re-using the same secret on both G1 and G2.

Use newer kilic library with Fr

Fr has been introduced now in kilic/ and we should switch to it instead of using our own big.Int wrapper for G1 G2 operations.

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.