1570af302Sopenharmony_ci#include <unistd.h>
2570af302Sopenharmony_ci#include <crypt.h>
3570af302Sopenharmony_ci
4570af302Sopenharmony_cichar *crypt(const char *key, const char *salt)
5570af302Sopenharmony_ci{
6570af302Sopenharmony_ci	/* This buffer is sufficiently large for all
7570af302Sopenharmony_ci	 * currently-supported hash types. It needs to be updated if
8570af302Sopenharmony_ci	 * longer hashes are added. The cast to struct crypt_data * is
9570af302Sopenharmony_ci	 * purely to meet the public API requirements of the crypt_r
10570af302Sopenharmony_ci	 * function; the implementation of crypt_r uses the object
11570af302Sopenharmony_ci	 * purely as a char buffer. */
12570af302Sopenharmony_ci	static char buf[128];
13570af302Sopenharmony_ci	return __crypt_r(key, salt, (struct crypt_data *)buf);
14570af302Sopenharmony_ci}
15