@@ -11,7 +11,7 @@ import {
1111import { FlareNetwork } from '@bitgo/statics' ;
1212import { Buffer } from 'buffer' ;
1313import { createHash } from 'crypto' ;
14- import { secp256k1 } from '@noble/curves /secp256k1' ;
14+ import { ecc } from '@bitgo /secp256k1' ;
1515import { ADDRESS_SEPARATOR , Output , DeprecatedTx } from './iface' ;
1616import bs58 from 'bs58' ;
1717import { bech32 } from 'bech32' ;
@@ -90,7 +90,7 @@ export class Utils implements BaseUtils {
9090 }
9191
9292 try {
93- secp256k1 . ProjectivePoint . fromHex ( pubBuf . toString ( 'hex' ) ) ;
93+ ecc . isPoint ( pubBuf ) ;
9494 return true ;
9595 } catch ( e ) {
9696 return false ;
@@ -121,8 +121,8 @@ export class Utils implements BaseUtils {
121121 */
122122 createSignature ( network : FlareNetwork , message : Buffer , prv : Buffer ) : Buffer {
123123 const messageHash = this . sha256 ( message ) ;
124- const signature = secp256k1 . sign ( messageHash , prv ) ;
125- return Buffer . from ( signature . toCompactRawBytes ( ) ) ;
124+ const signature = ecc . sign ( messageHash , prv ) ;
125+ return Buffer . from ( signature ) ;
126126 }
127127
128128 /**
@@ -131,7 +131,7 @@ export class Utils implements BaseUtils {
131131 verifySignature ( network : FlareNetwork , message : Buffer , signature : Buffer , publicKey : Buffer ) : boolean {
132132 try {
133133 const messageHash = this . sha256 ( message ) ;
134- return secp256k1 . verify ( signature , messageHash , publicKey ) ;
134+ return ecc . verify ( signature , messageHash , publicKey ) ;
135135 } catch ( e ) {
136136 return false ;
137137 }
0 commit comments