Validate the SM2 digest len before use