crypto: fix input validation in crypto.hash
#52070
Merged
input validation in crypto.hash
#52070