9
9
getCurves : _getCurves ,
10
10
getHashes : _getHashes ,
11
11
setEngine : _setEngine ,
12
- timingSafeEqual : _timingSafeEqual
13
12
} = internalBinding ( 'crypto' ) ;
14
13
15
14
const {
@@ -20,7 +19,6 @@ const {
20
19
hideStackFrames,
21
20
codes : {
22
21
ERR_CRYPTO_ENGINE_UNKNOWN ,
23
- ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH ,
24
22
ERR_INVALID_ARG_TYPE ,
25
23
}
26
24
} = require ( 'internal/errors' ) ;
@@ -76,21 +74,6 @@ function setEngine(id, flags) {
76
74
throw new ERR_CRYPTO_ENGINE_UNKNOWN ( id ) ;
77
75
}
78
76
79
- function timingSafeEqual ( buf1 , buf2 ) {
80
- if ( ! isArrayBufferView ( buf1 ) ) {
81
- throw new ERR_INVALID_ARG_TYPE ( 'buf1' ,
82
- [ 'Buffer' , 'TypedArray' , 'DataView' ] , buf1 ) ;
83
- }
84
- if ( ! isArrayBufferView ( buf2 ) ) {
85
- throw new ERR_INVALID_ARG_TYPE ( 'buf2' ,
86
- [ 'Buffer' , 'TypedArray' , 'DataView' ] , buf2 ) ;
87
- }
88
- if ( buf1 . byteLength !== buf2 . byteLength ) {
89
- throw new ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH ( ) ;
90
- }
91
- return _timingSafeEqual ( buf1 , buf2 ) ;
92
- }
93
-
94
77
const getArrayBufferView = hideStackFrames ( ( buffer , name , encoding ) => {
95
78
if ( typeof buffer === 'string' ) {
96
79
if ( encoding === 'buffer' )
@@ -116,6 +99,5 @@ module.exports = {
116
99
kHandle,
117
100
setDefaultEncoding,
118
101
setEngine,
119
- timingSafeEqual,
120
102
toBuf
121
103
} ;
0 commit comments