[PATCH v7 1/3] lib: introduce HASH_CALCULATE option