projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2985 from TheBlueMatt/2024-03-fix-upgradable-enum-121
[rust-lightning]
/
lightning
/
src
/
blinded_path
/
utils.rs
diff --git
a/lightning/src/blinded_path/utils.rs
b/lightning/src/blinded_path/utils.rs
index 33a2cde8c8f6666702b860a0b856bdf1d3c46ff2..d4894a86aa1a9069abdc9b2e073cd0a31c789048 100644
(file)
--- a/
lightning/src/blinded_path/utils.rs
+++ b/
lightning/src/blinded_path/utils.rs
@@
-18,8
+18,8
@@
use bitcoin::secp256k1::ecdh::SharedSecret;
use super::{BlindedHop, BlindedPath};
use crate::ln::msgs::DecodeError;
use crate::ln::onion_utils;
use super::{BlindedHop, BlindedPath};
use crate::ln::msgs::DecodeError;
use crate::ln::onion_utils;
-use crate::onion_message::Destination;
-use crate::
util::chacha20poly1305rfc
::ChaChaPolyWriteAdapter;
+use crate::onion_message::
messenger::
Destination;
+use crate::
crypto::streams
::ChaChaPolyWriteAdapter;
use crate::util::ser::{Readable, Writeable};
use crate::io;
use crate::util::ser::{Readable, Writeable};
use crate::io;
@@
-49,7
+49,7
@@
where
let hop_pk_blinding_factor = {
let mut hmac = HmacEngine::<Sha256>::new(b"blinded_node_id");
hmac.input(encrypted_data_ss.as_ref());
let hop_pk_blinding_factor = {
let mut hmac = HmacEngine::<Sha256>::new(b"blinded_node_id");
hmac.input(encrypted_data_ss.as_ref());
- Hmac::from_engine(hmac).
into_inner
()
+ Hmac::from_engine(hmac).
to_byte_array
()
};
$pk.mul_tweak(secp_ctx, &Scalar::from_be_bytes(hop_pk_blinding_factor).unwrap())?
};
};
$pk.mul_tweak(secp_ctx, &Scalar::from_be_bytes(hop_pk_blinding_factor).unwrap())?
};
@@
-70,7
+70,7
@@
where
let mut sha = Sha256::engine();
sha.input(&msg_blinding_point.serialize()[..]);
sha.input(encrypted_data_ss.as_ref());
let mut sha = Sha256::engine();
sha.input(&msg_blinding_point.serialize()[..]);
sha.input(encrypted_data_ss.as_ref());
- Sha256::from_engine(sha).
into_inner
()
+ Sha256::from_engine(sha).
to_byte_array
()
};
msg_blinding_point_priv = msg_blinding_point_priv.mul_tweak(&Scalar::from_be_bytes(msg_blinding_point_blinding_factor).unwrap())?;
};
msg_blinding_point_priv = msg_blinding_point_priv.mul_tweak(&Scalar::from_be_bytes(msg_blinding_point_blinding_factor).unwrap())?;
@@
-80,7
+80,7
@@
where
let mut sha = Sha256::engine();
sha.input(&onion_packet_pubkey.serialize()[..]);
sha.input(onion_packet_ss.as_ref());
let mut sha = Sha256::engine();
sha.input(&onion_packet_pubkey.serialize()[..]);
sha.input(onion_packet_ss.as_ref());
- Sha256::from_engine(sha).
into_inner
()
+ Sha256::from_engine(sha).
to_byte_array
()
};
onion_packet_pubkey_priv = onion_packet_pubkey_priv.mul_tweak(&Scalar::from_be_bytes(onion_packet_pubkey_blinding_factor).unwrap())?;
onion_packet_pubkey = PublicKey::from_secret_key(secp_ctx, &onion_packet_pubkey_priv);
};
onion_packet_pubkey_priv = onion_packet_pubkey_priv.mul_tweak(&Scalar::from_be_bytes(onion_packet_pubkey_blinding_factor).unwrap())?;
onion_packet_pubkey = PublicKey::from_secret_key(secp_ctx, &onion_packet_pubkey_priv);