File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ pub mod tx_builder;
7575
7676pub ( crate ) const COMPRESSED_PUBLIC_KEY_SIZE : usize = bitcoin:: secp256k1:: constants:: PUBLIC_KEY_SIZE ;
7777
78+ // Standard low-S ECDSA signatures fit in the secp256k1 DER bound; the appended sighash byte
79+ // replaces the extra DER padding byte that a high-S signature could require.
7880pub ( crate ) const MAX_STANDARD_SIGNATURE_SIZE : usize =
7981 bitcoin:: secp256k1:: constants:: MAX_SIGNATURE_SIZE ;
8082
@@ -135,7 +137,6 @@ impl_writeable_tlv_based!(DelayedPaymentOutputDescriptor, {
135137pub ( crate ) const P2WPKH_WITNESS_WEIGHT : u64 = ( 1 /* witness items */
136138 + 1 /* sig push */
137139 + MAX_STANDARD_SIGNATURE_SIZE
138- + 1 /* sighash flag */
139140 + 1 /* pubkey push */
140141 + COMPRESSED_PUBLIC_KEY_SIZE ) as u64 ;
141142
@@ -2714,15 +2715,6 @@ pub fn dyn_sign() {
27142715 let _signer: Box < dyn EcdsaChannelSigner > ;
27152716}
27162717
2717- #[ test]
2718- pub fn p2wpkh_witness_weight_matches_serialized_witness ( ) {
2719- let witness = Witness :: from_slice ( & [
2720- vec ! [ 0 ; MAX_STANDARD_SIGNATURE_SIZE + 1 ] ,
2721- vec ! [ 0 ; COMPRESSED_PUBLIC_KEY_SIZE ] ,
2722- ] ) ;
2723- assert_eq ! ( witness. size( ) as u64 , P2WPKH_WITNESS_WEIGHT ) ;
2724- }
2725-
27262718#[ cfg( ldk_bench) ]
27272719pub mod benches {
27282720 use crate :: sign:: { EntropySource , KeysManager } ;
You can’t perform that action at this time.
0 commit comments