let mut hmac = HmacEngine::<Sha256>::new(&keys.ldk_pmt_hash_key);
hmac.input(&iv_bytes);
hmac.input(&metadata_bytes);
- let payment_preimage_bytes = Hmac::from_engine(hmac).into_inner();
+ let payment_preimage_bytes = Hmac::from_engine(hmac).to_byte_array();
- let ldk_pmt_hash = PaymentHash(Sha256::hash(&payment_preimage_bytes).into_inner());
+ let ldk_pmt_hash = PaymentHash(Sha256::hash(&payment_preimage_bytes).to_byte_array());
let payment_secret = construct_payment_secret(&iv_bytes, &metadata_bytes, &keys.metadata_key);
Ok((ldk_pmt_hash, payment_secret))
}
let mut hmac = HmacEngine::<Sha256>::new(&keys.user_pmt_hash_key);
hmac.input(&metadata_bytes);
hmac.input(&payment_hash.0);
- let hmac_bytes = Hmac::from_engine(hmac).into_inner();
+ let hmac_bytes = Hmac::from_engine(hmac).to_byte_array();
let mut iv_bytes = [0 as u8; IV_LEN];
iv_bytes.copy_from_slice(&hmac_bytes[..IV_LEN]);
let mut hmac = HmacEngine::<Sha256>::new(&keys.user_pmt_hash_key);
hmac.input(&metadata_bytes[..]);
hmac.input(&payment_hash.0);
- if !fixed_time_eq(&iv_bytes, &Hmac::from_engine(hmac).into_inner().split_at_mut(IV_LEN).0) {
+ if !fixed_time_eq(&iv_bytes, &Hmac::from_engine(hmac).to_byte_array().split_at_mut(IV_LEN).0) {
log_trace!(logger, "Failing HTLC with user-generated payment_hash {}: unexpected payment_secret", &payment_hash);
return Err(())
}
let mut hmac = HmacEngine::<Sha256>::new(&keys.ldk_pmt_hash_key);
hmac.input(iv_bytes);
hmac.input(metadata_bytes);
- let decoded_payment_preimage = Hmac::from_engine(hmac).into_inner();
- if !fixed_time_eq(&payment_hash.0, &Sha256::hash(&decoded_payment_preimage).into_inner()) {
+ let decoded_payment_preimage = Hmac::from_engine(hmac).to_byte_array();
+ if !fixed_time_eq(&payment_hash.0, &Sha256::hash(&decoded_payment_preimage).to_byte_array()) {
return Err(decoded_payment_preimage);
}
return Ok(PaymentPreimage(decoded_payment_preimage))