+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
use ln::msgs::LightningError;
use ln::msgs;
PeerChannelEncryptor {
their_node_id: Some(their_node_id),
- secp_ctx: secp_ctx,
+ secp_ctx,
noise_state: NoiseState::InProgress {
state: NoiseStep::PreActOne,
directional_state: DirectionalNoiseState::Outbound {
ie: ephemeral_key,
},
bidirectional_state: BidirectionalNoiseState {
- h: h,
+ h,
ck: NOISE_CK,
},
}
PeerChannelEncryptor {
their_node_id: None,
- secp_ctx: secp_ctx,
+ secp_ctx,
noise_state: NoiseState::InProgress {
state: NoiseStep::PreActOne,
directional_state: DirectionalNoiseState::Inbound {
temp_k2: None,
},
bidirectional_state: BidirectionalNoiseState {
- h: h,
+ h,
ck: NOISE_CK,
},
}
let (sk, rk) = final_hkdf;
self.noise_state = NoiseState::Finished {
- sk: sk,
+ sk,
sn: 0,
sck: ck.clone(),
- rk: rk,
+ rk,
rn: 0,
rck: ck,
};
let (rk, sk) = final_hkdf;
self.noise_state = NoiseState::Finished {
- sk: sk,
+ sk,
sn: 0,
sck: ck.clone(),
- rk: rk,
+ rk,
rn: 0,
rck: ck,
};