private static byte[] digestUsingAlgorithm(
      final Bytes input, final Supplier<MessageDigest> digestSupplier) {
    try {
      final MessageDigest digest = (MessageDigest) digestSupplier.get().clone();
      input.update(digest);
      return digest.digest();
    } catch (final CloneNotSupportedException e) {
      throw new RuntimeException(e);
    }
  }
Helper method to generate a digest using the provided algorithm.

@param input The input bytes to produce the digest for.
@param digestSupplier the digest supplier to use
@return A digest.
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/Hash.java