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.
This commit is contained in:
parent
a15b4721be
commit
d8ad15059d
|
@ -79,8 +79,10 @@ impl<T: SigType> SignatureCase<T> {
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue