public static boolean verify(byte[] data,byte[] signature,byte[] pub) throws AssertFailException {
  Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520);
  ByteBuffer byteBuff=nativeECDSABuffer.get();
  if (byteBuff == null || byteBuff.capacity() < 520) {
    byteBuff=ByteBuffer.allocateDirect(520);
    byteBuff.order(ByteOrder.nativeOrder());
    nativeECDSABuffer.set(byteBuff);
  }
  byteBuff.rewind();
  byteBuff.put(data);
  byteBuff.put(signature);
  byteBuff.put(pub);
  byte[][] retByteArray;
  r.lock();
  try {
    return secp256k1_ecdsa_verify(byteBuff,Secp256k1Context.getContext(),signature.length,pub.length) == 1;
  }
  finally {
    r.unlock();
  }
}

public static boolean verify ( byte [ ] data , byte [ ] signature , byte [ ] pub ) throws AssertFailException { Preconditions . checkArgument ( data . length == 32 && signature . length <= 520 && pub . length <= 520 ) ; ByteBuffer byteBuff = nativeECDSABuffer . get ( ) ; if ( byteBuff == null || byteBuff . capacity ( ) < 520 ) { byteBuff = ByteBuffer . allocateDirect ( 520 ) ; byteBuff . order ( ByteOrder . nativeOrder ( ) ) ; nativeECDSABuffer . set ( byteBuff ) ; } byteBuff . rewind ( ) ; byteBuff . put ( data ) ; byteBuff . put ( signature ) ; byteBuff . put ( pub ) ; byte [ ] [ ] retByteArray ; r . lock ( ) ; try { return secp256k1_ecdsa_verify ( byteBuff , Secp256k1Context . getContext ( ) , signature . length , pub . length ) == 1 ; } finally { r . unlock ( ) ; } }
verifies the given secp256k1 signature in native code . calling when enabled = = false is undefined ( probably library not loaded )
