From d8ad15059d2202499b8288057259739df9397da9 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 9 Dec 2019 12:15:11 -0800 Subject: [PATCH] Try to prevent ChangePubkey tweaks from becoming a no-op. Since we expect the signature to fail if ChangePubkey is applied, we need to make sure it actually changes the signature test case. --- tests/proptests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/proptests.rs b/tests/proptests.rs index f6bf9f0..2acef84 100644 --- a/tests/proptests.rs +++ b/tests/proptests.rs @@ -79,8 +79,10 @@ impl SignatureCase { Tweak::ChangePubkey => { // Changing the public key makes the signature invalid. let mut bytes: [u8; 32] = self.pk_bytes.clone().into(); + let j = (bytes[2] & 31) as usize; bytes[2] ^= 0x23; bytes[2] |= 0x99; + bytes[j] ^= bytes[2]; self.pk_bytes = bytes.into(); self.is_valid = false; }