[BACK]Return to crypt.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcrypt

File: [cvs.NetBSD.org] / src / lib / libcrypt / crypt.h (download)

Revision 1.3, Wed Jan 12 03:32:52 2005 UTC (19 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.2: +6 -6 lines

- change the gensalt functions to take an optional string instead of
  the number of rounds.
- make pw_gensalt() more generic, so that it does not depend in libutil.

/*
 * $NetBSD: crypt.h,v 1.3 2005/01/12 03:32:52 christos Exp $
 */
char	*__md5crypt(const char *pw, const char *salt);	/* XXX */
char *__bcrypt(const char *, const char *);	/* XXX */
char *__crypt_sha1(const char *pw, const char *salt);
unsigned int __crypt_sha1_iterations (unsigned int hint);
void __hmac_sha1(unsigned char *, size_t, unsigned char *, size_t, unsigned char *);
void __crypt_to64(char *s, u_int32_t v, int n);

int __gensalt_blowfish(char *salt, size_t saltlen, const char *option);
int __gensalt_old(char *salt, size_t saltsiz, const char *option);
int __gensalt_new(char *salt, size_t saltsiz, const char *option);
int __gensalt_md5(char *salt, size_t saltsiz, const char *option);
int __gensalt_sha1(char *salt, size_t saltsiz, const char *option);

#define SHA1_MAGIC "$sha1$"
#define SHA1_SIZE 20