Added 0 key proof error
Private key \x00\x00...\x00 returns the _exact_ same public key as \x11 \x11...\x11. Currently investigating.
This commit is contained in:
parent
8d1637f567
commit
bcb1166e52
|
@ -6,6 +6,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/ethutil"
|
||||||
|
"github.com/obscuren/secp256k1-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These tests are sanity checks.
|
// These tests are sanity checks.
|
||||||
|
@ -47,3 +50,13 @@ func BenchmarkSha3(b *testing.B) {
|
||||||
|
|
||||||
fmt.Println(amount, ":", time.Since(start))
|
fmt.Println(amount, ":", time.Since(start))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test0Key(t *testing.T) {
|
||||||
|
|
||||||
|
key := ethutil.Hex2Bytes("1111111111111111111111111111111111111111111111111111111111111111")
|
||||||
|
|
||||||
|
p, err := secp256k1.GeneratePubKey(key)
|
||||||
|
addr := Sha3(p[1:])[12:]
|
||||||
|
fmt.Printf("%x\n", p)
|
||||||
|
fmt.Printf("%v %x\n", err, addr)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue