crypto: stm32/hash - Simplify code