Commit bcb1166e authored by obscuren's avatar obscuren

Added 0 key proof error

Private key \x00\x00...\x00 returns the _exact_ same public key as \x11
\x11...\x11. Currently investigating.
parent 8d1637f5
...@@ -6,6 +6,9 @@ import ( ...@@ -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) { ...@@ -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)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment