lib/signature.js
function( signature, input, key ) {

    var length = ( this.bits / 8 | 0 ) + ( this.bits % 8 !== 0 ? 1 : 0 )
    if( signature.length !== length * 2 )
      return false

    var sig = ECDSASignature.encode({
      r: new BigNum( signature.slice( 0, length ), 10, 'be' ).iabs(),
      s: new BigNum( signature.slice( length ), 10, 'be' ).iabs(),
    }, 'der' )

    return crypto.createVerify( this.algorithm + this.bits )
      .update( input )
      .verify( key, sig, 'base64' )

  }
function( signature, input, key ) {

    var length = ( this.bits / 8 | 0 ) + ( this.bits % 8 !== 0 ? 1 : 0 )
    if( signature.length !== length * 2 )
      return false

    var sig = ECDSASignature.encode({
      r: new BigNum( signature.slice( 0, length ), 10, 'be' ).iabs(),
      s: new BigNum( signature.slice( length ), 10, 'be' ).iabs(),
    }, 'der' )

    return crypto.createVerify( this.algorithm + this.bits )
      .update( input )
      .verify( key, sig, 'base64' )

  }
function ( signature , input , key ) { var length = ( this . bits / 8 | 0 ) + ( this . bits % 8 !== 0 ? 1 : 0 ) if ( signature . length !== length * 2 ) return false var sig = ECDSASignature . encode ( { r : new BigNum ( signature . slice ( 0 , length ) , 10 , 'be' ) . iabs ( ) , s : new BigNum ( signature . slice ( length ) , 10 , 'be' ) . iabs ( ) , } , 'der' ) return crypto . createVerify ( this . algorithm + this . bits ) . update ( input ) . verify ( key , sig , 'base64' ) }
Verify an ECDSA signature
@internal used by `.verify()`
@param  {Buffer} signature
@param  {Buffer} input
@param  {Buffer} key
@return {Boolean}
Verify an ECDSA signature