Modify ecdh to take Scalar
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index 9b3f1cd365b12ee148e1a5638254614f79a1a3d3..372bed6049370c065c0d7a660f61a466ec715bd4 100644 (file)
@@ -168,10 +168,10 @@ impl KeysInterface for KeyProvider {
                Ok(SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, self.node_id]).unwrap())
        }
 
-       fn ecdh(&self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&[u8; 32]>) -> Result<SharedSecret, ()> {
+       fn ecdh(&self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&Scalar>) -> Result<SharedSecret, ()> {
                let mut node_secret = self.get_node_secret(recipient)?;
                if let Some(tweak) = tweak {
-                       node_secret = node_secret.mul_tweak(&Scalar::from_be_bytes(*tweak).unwrap()).unwrap();
+                       node_secret = node_secret.mul_tweak(tweak).unwrap();
                }
                Ok(SharedSecret::new(other_key, &node_secret))
        }