From: Elias Rohrer Date: Mon, 16 Sep 2024 10:28:41 +0000 (+0200) Subject: `rustfmt`: Run on `crypto/utils.rs` X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=3fea0c2cac392962cad1560c8df07d8bcbbb3c79;p=rust-lightning `rustfmt`: Run on `crypto/utils.rs` --- diff --git a/lightning/src/crypto/utils.rs b/lightning/src/crypto/utils.rs index aab406157..cd4d9bfa6 100644 --- a/lightning/src/crypto/utils.rs +++ b/lightning/src/crypto/utils.rs @@ -1,7 +1,7 @@ -use bitcoin::hashes::{Hash, HashEngine}; use bitcoin::hashes::hmac::{Hmac, HmacEngine}; use bitcoin::hashes::sha256::Hash as Sha256; -use bitcoin::secp256k1::{Message, Secp256k1, SecretKey, ecdsa::Signature, Signing}; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::secp256k1::{ecdsa::Signature, Message, Secp256k1, SecretKey, Signing}; use crate::sign::EntropySource; @@ -43,14 +43,16 @@ macro_rules! hkdf_extract_expand { let k5 = Hmac::from_engine(hmac).to_byte_array(); (k1, k2, k3, k4, k5) - }} + }}; } pub fn hkdf_extract_expand_twice(salt: &[u8], ikm: &[u8]) -> ([u8; 32], [u8; 32]) { hkdf_extract_expand!(salt, ikm, 2) } -pub fn hkdf_extract_expand_5x(salt: &[u8], ikm: &[u8]) -> ([u8; 32], [u8; 32], [u8; 32], [u8; 32], [u8; 32]) { +pub fn hkdf_extract_expand_5x( + salt: &[u8], ikm: &[u8], +) -> ([u8; 32], [u8; 32], [u8; 32], [u8; 32], [u8; 32]) { hkdf_extract_expand!(salt, ikm, 5) } @@ -66,8 +68,11 @@ pub fn sign(ctx: &Secp256k1, msg: &Message, sk: &SecretKey) -> Si #[inline] #[allow(unused_variables)] pub fn sign_with_aux_rand( - ctx: &Secp256k1, msg: &Message, sk: &SecretKey, entropy_source: &ES -) -> Signature where ES::Target: EntropySource { + ctx: &Secp256k1, msg: &Message, sk: &SecretKey, entropy_source: &ES, +) -> Signature +where + ES::Target: EntropySource, +{ #[cfg(feature = "grind_signatures")] let sig = loop { let sig = ctx.sign_ecdsa_with_noncedata(msg, sk, &entropy_source.get_secure_random_bytes());