-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;
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)
}
#[inline]
#[allow(unused_variables)]
pub fn sign_with_aux_rand<C: Signing, ES: Deref>(
- ctx: &Secp256k1<C>, msg: &Message, sk: &SecretKey, entropy_source: &ES
-) -> Signature where ES::Target: EntropySource {
+ ctx: &Secp256k1<C>, 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());