@Override
  public boolean verify(final Bytes data, final SECPSignature signature, final SECPPublicKey pub) {
    final ECDSASigner signer = new ECDSASigner();
    final Bytes toDecode = Bytes.wrap(Bytes.of((byte) 4), pub.getEncodedBytes());
    final ECPublicKeyParameters params =
        new ECPublicKeyParameters(curve.getCurve().decodePoint(toDecode.toArrayUnsafe()), curve);
    signer.init(false, params);
    try {
      return signer.verifySignature(data.toArrayUnsafe(), signature.getR(), signature.getS());
    } catch (final 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.
      return false;
    }
  }
Verifies the given ECDSA signature against the message bytes using the public key bytes.

<p>When using native ECDSA verification, data must be 32 bytes, and no element may be larger
than 520 bytes.

@param data Hash of the data to verify.
@param signature ASN.1 encoded signature.
@param pub The public key bytes to use.
@return True if the verification is successful.
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/AbstractSECP256.java