code: public static boolean verify(byte[] data, ECDSASignature signature, byte[] pub) {
          if (FAKE_SIGNATURES)
              return true;
  
          if (Secp256k1Context.isEnabled()) {
              try {
                  return NativeSecp256k1.verify(data, signature.encodeToDER(), pub);
              } catch (NativeSecp256k1Util.AssertFailException e) {
                  log.error("Caught AssertFailException inside secp256k1", e);
                  return false;
              }
          }
  
          ECDSASigner signer = new ECDSASigner();
          ECPublicKeyParameters params = new ECPublicKeyParameters(CURVE.getCurve().decodePoint(pub), CURVE);
          signer.init(false, params);
          try {
              return signer.verifySignature(data, signature.r, signature.s);
          } catch (NullPointerException e) {
              // Bouncy Castle contains a bug that can cause NPEs given specially crafted signatures. Those signatures
              // are inherently invalid/attack sigs so we just fail them here rather than crash the thread.
              log.error("Caught NPE inside bouncy castle", e);
              return false;
          }
      }
docs: <p>Verifies the given ECDSA signature against the message bytes using the public key bytes.</p>
  
  <p>When using native ECDSA verification, data must be 32 bytes, and no element may be
  larger than 520 bytes.</p>
  
  @param data      Hash of the data to verify.
  @param signature ASN.1 encoded signature.
  @param pub       The public key bytes to use.