File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { TinySecp256k1Interface } from './types' ;
2
- export declare function initEccLib ( eccLib : TinySecp256k1Interface | undefined ) : void ;
2
+ export declare function initEccLib ( eccLib : TinySecp256k1Interface | undefined , skipVerification ?: boolean ) : void ;
3
3
export declare function getEccLib ( ) : TinySecp256k1Interface ;
Original file line number Diff line number Diff line change 2
2
Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
3
3
exports . getEccLib = exports . initEccLib = void 0 ;
4
4
const _ECCLIB_CACHE = { } ;
5
- function initEccLib ( eccLib ) {
5
+ function initEccLib ( eccLib , skipVerification ) {
6
6
if ( ! eccLib ) {
7
7
// allow clearing the library
8
8
_ECCLIB_CACHE . eccLib = eccLib ;
9
9
} else if ( eccLib !== _ECCLIB_CACHE . eccLib ) {
10
- // new instance, verify it
11
- verifyEcc ( eccLib ) ;
10
+ if ( ! skipVerification )
11
+ // new instance, verify it
12
+ verifyEcc ( eccLib ) ;
12
13
_ECCLIB_CACHE . eccLib = eccLib ;
13
14
}
14
15
}
Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ import { TinySecp256k1Interface } from './types';
2
2
3
3
const _ECCLIB_CACHE : { eccLib ?: TinySecp256k1Interface } = { } ;
4
4
5
- export function initEccLib ( eccLib : TinySecp256k1Interface | undefined ) : void {
5
+ export function initEccLib (
6
+ eccLib : TinySecp256k1Interface | undefined ,
7
+ skipVerification ?: boolean ,
8
+ ) : void {
6
9
if ( ! eccLib ) {
7
10
// allow clearing the library
8
11
_ECCLIB_CACHE . eccLib = eccLib ;
9
12
} else if ( eccLib !== _ECCLIB_CACHE . eccLib ) {
10
- // new instance, verify it
11
- verifyEcc ( eccLib ! ) ;
13
+ if ( ! skipVerification )
14
+ // new instance, verify it
15
+ verifyEcc ( eccLib ! ) ;
12
16
_ECCLIB_CACHE . eccLib = eccLib ;
13
17
}
14
18
}
You can’t perform that action at this time.
0 commit comments