pbkdf2-hmac-sha512: better valid()