mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
crypto: add test for valid signature + invalid pubkey
This commit is contained in:
parent
4565c6e1e2
commit
1f99eff9e3
1 changed files with 5 additions and 0 deletions
|
|
@ -68,6 +68,11 @@ func TestVerifySignature(t *testing.T) {
|
|||
if VerifySignature(testpubkey, testmsg, sig[:len(sig)-2]) {
|
||||
t.Errorf("signature valid even though it's incomplete")
|
||||
}
|
||||
wrongkey := common.CopyBytes(testpubkey)
|
||||
wrongkey[10]++
|
||||
if VerifySignature(wrongkey, testmsg, sig) {
|
||||
t.Errorf("signature valid with with wrong public key")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecompressPubkey(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue