public static boolean verifySignature(@NonNull final byte[] hash,
			@NonNull final ECDSASignature signature, @NonNull final ECPoint Q) {

		// 0. Check Q is not identity and is on the curve
		// If not, the public key is invalid.
		if (Q.isInfinity()) {
			return false;
		}
		if (!Q.multiply(N).isInfinity()) {
			return false;
		}

		// 1. Verify that r and s are integers in the interval [1,n-1].
		// If not, the signature is invalid.
		if (!signature.isValid()) {
			return false;
		}

		// 2. Calculate e = HASH(message)
		// 3. and Let z be the n.bitLength() leftmost bits of e.
		final BigInteger z = calculateZ(hash);

		// 4. Calculate w = s^-1
		final BigInteger w = signature.getS().modInverse(N);

		// 5. Calculate u1 = z.w and u2 = r.w
		final BigInteger u1 = z.multiply(w).mod(N);
		final BigInteger u2 = signature.getR().multiply(w).mod(N);

		// 6. Calculate the curve point u1 * G + u2 * Q
		final ECPoint point = sumOfTwoMultiplies(G, u1, Q, u2);

		// 7. The signature is valid if r=point.x, invalid otherwise.
		final ECFieldElement coorX = point.getX();
		if (coorX == null) {
			return false; // Got infinity !?
		}
		final BigInteger v = coorX.toBigInteger().mod(N);

		return signature.getR().equals(v);
	}