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 11import { TinySecp256k1Interface } from './types' ;
2- export declare function initEccLib ( eccLib : TinySecp256k1Interface | undefined ) : void ;
2+ export declare function initEccLib ( eccLib : TinySecp256k1Interface | undefined , skipVerification ?: boolean ) : void ;
33export declare function getEccLib ( ) : TinySecp256k1Interface ;
Original file line number Diff line number Diff line change 22Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
33exports . getEccLib = exports . initEccLib = void 0 ;
44const _ECCLIB_CACHE = { } ;
5- function initEccLib ( eccLib ) {
5+ function initEccLib ( eccLib , skipVerification ) {
66 if ( ! eccLib ) {
77 // allow clearing the library
88 _ECCLIB_CACHE . eccLib = eccLib ;
99 } 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 ) ;
1213 _ECCLIB_CACHE . eccLib = eccLib ;
1314 }
1415}
Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ import { TinySecp256k1Interface } from './types';
22
33const _ECCLIB_CACHE : { eccLib ?: TinySecp256k1Interface } = { } ;
44
5- export function initEccLib ( eccLib : TinySecp256k1Interface | undefined ) : void {
5+ export function initEccLib (
6+ eccLib : TinySecp256k1Interface | undefined ,
7+ skipVerification ?: boolean ,
8+ ) : void {
69 if ( ! eccLib ) {
710 // allow clearing the library
811 _ECCLIB_CACHE . eccLib = eccLib ;
912 } 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 ! ) ;
1216 _ECCLIB_CACHE . eccLib = eccLib ;
1317 }
1418}
You can’t perform that action at this time.
0 commit comments