Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate Ethereum-optimized Schnorr threshold signatures #1272

Open
wants to merge 4 commits into
base: develop
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -8,3 +8,4 @@ examples/testnet/contracts/Aggregator.sol
examples/testnet/contracts/AggregatorProxy.sol
evm/contracts/lib
evm/box/node_modules
evm/node_modules

Some generated files are not rendered by default. Learn more.

@@ -7,6 +7,7 @@ import (
"io"
"io/ioutil"
"log"
"math/rand"
"net/http"
"net/http/httptest"
"reflect"
@@ -750,3 +751,27 @@ type MockPasswordPrompter struct {
func (m MockPasswordPrompter) Prompt() string {
return m.Password
}

// randomStream implements cipher.Stream, but with a deterministic output.
type randomStream rand.Rand

// NewStream returns a randomStream seeded from seed, for deterministic
// randomness in tests of random outputs, and for small property-based tests.
//
// This API is deliberately awkward to prevent it from being used outside of
// tests.
//
// The testing framework runs the tests in a file in series, unless you
// explicitly request otherwise with testing.T.Parallel(). So one such stream
// per file is enough, most of the time.
func NewStream(t *testing.T, seed int64) *randomStream {
return (*randomStream)(rand.New(rand.NewSource(seed)))
}

// XORKeyStream dumps the output from a math/rand PRNG on dst.
//
// It gives no consideration for the contents of src, and is named so
// misleadingly purely to satisfy the cipher.Stream interface.
func (s *randomStream) XORKeyStream(dst, src []byte) {
(*rand.Rand)(s).Read(dst)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.