Giter Club home page Giter Club logo

kyber's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kyber's Issues

Consider using keyed Blake instead of prepend the tag?

Currently we prepend a fixed tag to our mesages when we are hashing data:

kyber/encrypt/ibe/ibe.go

Lines 132 to 138 in a780ab2

h3, err := blake2s.NewXOF(maxSize, nil)
if err != nil {
panic(err)
}
if _, err := h3.Write(H3Tag()); err != nil {
return nil, fmt.Errorf("err hashing h3 tag: %v", err)
}

I think we should consider using keyed Blake instead of prepend the tag. It would be as simply as replacing the nil in the Blake2s instantiation with the H3Tag.

@nikkolasg It would simplify a bit the code and also, keyed hash functions are there exactly for this usecase, no?

Extract hashing function in Kyber IBE to interface

See this PR comment: #28 (comment)

Presently blake2s is hardcoded into the IBE module.
We should extract the hashing logic to an interface to enable the caller to provide their own hashing function.
Blake2s should still be the default implementation for callers who don't wish to provide an alternative.

Cut a release

There have been quite a few changes since the last release, can we get a new one?

Run tests with with `-race` flag and fix race conditions

While replacing circle CI with github actions, @AnomalRoil suggested running the go test runner with the race flag to check for race conditions. This identified some race conditions in DKG code that require investigation and remediating.

During prior investigation, a data access races were identified in the StatusMatrix struct implementation. Adding some generic RW locking worked fine on my local machine and the tests (including race condition testing) passed successfully.
On the github actions runner however the TestProtoFull test in proto_test.go appeared to suffer deadlock (albeit the go runtime did not detect this). Note: this deadlock does not happen without the -lock flag

Some attempts I tried to remedy this:

  • updating go to 1.18
  • adding test flag GO111MODULE=on
  • adding test flag GODEBUG=cgocheck=2 (see golang/go#48402)
  • modifying the resCh in TestProtoFull buffer size to 0 and 2 (see golang/go#48402)
  • running tests without make
  • implementations of StatusMatrixwith RWLock and vanilla Lock
  • a variety of timeouts up to 30mins
  • running macos-latest and ubuntu-latest github runners

Hash to group must be domain-separated.

The current interface for hashing to group elements must consider the use of domain separation strings.

This is aligned with hash to curve IETF specification. All hashes must be domain-separated, so a protocol can specify the separation when the hash is invoked as different random oracles. See more https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#name-domain-separation-requireme

Current:

kyber/hash.go

Lines 13 to 15 in 5706fa5

type HashablePoint interface {
Hash([]byte) Point
}

Proposed:

type HashablePoint interface { 
    Hash(msg, dst []byte) Point 
} 

DKG: eviction rule should look if it is for itself

Current the eviction rules only look generally, but don't look if the node being evicted is himself. If it is, it should already return an error and quit the DKG. Right now, an evicted node would finish the DKG normally if being evicted and return group and share but its share would be invalid.

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.