crypto: add test for valid signature + invalid pubkey

This commit is contained in:
Felix Lange 2017-12-08 16:04:00 +01:00
parent 4565c6e1e2
commit 1f99eff9e3

View file

@ -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) {