Rewrite pbkdf1 implementation from man page of EVP_BytesToKey, add better unit tests