crypto: clean up parameter validation in HKDF
-
validateByteSource
internally always callstoBuf
, so reuse that value instead of callingtoBuf
both invalidateParameters
and invalidateByteSource
. - Validate
digest
beforekey
. This improves the error message when no arguments are specified: it now refers to the type of the first argument, not to the type of the second argument.