@@ -5,9 +5,6 @@ const buffer_1 = require('buffer');
5
5
const bcrypto = require ( '../crypto' ) ;
6
6
const bufferutils_1 = require ( '../bufferutils' ) ;
7
7
const types_1 = require ( '../types' ) ;
8
- const TAP_LEAF_TAG = 'TapLeaf' ;
9
- const TAP_BRANCH_TAG = 'TapBranch' ;
10
- const TAP_TWEAK_TAG = 'TapTweak' ;
11
8
exports . LEAF_VERSION_TAPSCRIPT = 0xc0 ;
12
9
function rootHashFromPath ( controlBlock , tapleafMsg ) {
13
10
const k = [ tapleafMsg ] ;
@@ -70,7 +67,7 @@ exports.findScriptPath = findScriptPath;
70
67
function tapleafHash ( leaf ) {
71
68
const version = leaf . version || exports . LEAF_VERSION_TAPSCRIPT ;
72
69
return bcrypto . taggedHash (
73
- TAP_LEAF_TAG ,
70
+ 'TapLeaf' ,
74
71
buffer_1 . Buffer . concat ( [
75
72
buffer_1 . Buffer . from ( [ version ] ) ,
76
73
serializeScript ( leaf . output ) ,
@@ -80,13 +77,13 @@ function tapleafHash(leaf) {
80
77
exports . tapleafHash = tapleafHash ;
81
78
function tapTweakHash ( pubKey , h ) {
82
79
return bcrypto . taggedHash (
83
- TAP_TWEAK_TAG ,
80
+ 'TapTweak' ,
84
81
buffer_1 . Buffer . concat ( h ? [ pubKey , h ] : [ pubKey ] ) ,
85
82
) ;
86
83
}
87
84
exports . tapTweakHash = tapTweakHash ;
88
85
function tapBranchHash ( a , b ) {
89
- return bcrypto . taggedHash ( TAP_BRANCH_TAG , buffer_1 . Buffer . concat ( [ a , b ] ) ) ;
86
+ return bcrypto . taggedHash ( 'TapBranch' , buffer_1 . Buffer . concat ( [ a , b ] ) ) ;
90
87
}
91
88
function serializeScript ( s ) {
92
89
const varintLen = bufferutils_1 . varuint . encodingLength ( s . length ) ;
0 commit comments