@Override
  public Optional<SECPPublicKey> recoverPublicKeyFromSignature(
      final Bytes32 dataHash, final SECPSignature signature) {
    if (useNative) {
      Optional<SECPPublicKey> result = recoverFromSignatureNative(dataHash, signature);
      if (result.isEmpty()) {
        throw new IllegalArgumentException("Could not recover public key");
      } else {
        return result;
      }
    } else {
      return super.recoverPublicKeyFromSignature(dataHash, signature);
    }
  }
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/SECP256K1.java