Skip to content

Commit bcb1166

Browse files
committed
Added 0 key proof error
Private key \x00\x00...\x00 returns the _exact_ same public key as \x11 \x11...\x11. Currently investigating.
1 parent 8d1637f commit bcb1166

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎crypto/crypto_test.go‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import (
66
"fmt"
77
"testing"
88
"time"
9+
10+
"github.com/ethereum/go-ethereum/ethutil"
11+
"github.com/obscuren/secp256k1-go"
912
)
1013

1114
// These tests are sanity checks.
@@ -47,3 +50,13 @@ func BenchmarkSha3(b *testing.B) {
4750

4851
fmt.Println(amount, ":", time.Since(start))
4952
}
53+
54+
func Test0Key(t *testing.T) {
55+
56+
key := ethutil.Hex2Bytes("1111111111111111111111111111111111111111111111111111111111111111")
57+
58+
p, err := secp256k1.GeneratePubKey(key)
59+
addr := Sha3(p[1:])[12:]
60+
fmt.Printf("%x\n", p)
61+
fmt.Printf("%v %x\n", err, addr)
62+
}

0 commit comments

Comments
 (0)