Commit Graph

14 Commits

Author SHA1 Message Date
riastradh 969998948d Import SHA-3 code into libc and libkern.
No new public symbols in libc, but publishing the symbols is a simple
matter if/when we decide to do so.

Proposed on tech-kern and tech-userlevel with no objections:

https://mail-index.NetBSD.org/tech-kern/2017/11/11/msg022581.html
https://mail-index.NetBSD.org/tech-userlevel/2017/11/11/msg010968.html
2017-11-30 05:47:24 +00:00
christos a1d87d3311 new hmac function. 2016-07-01 22:41:39 +00:00
rmind ea196989a7 Add MurmurHash2 -- a non-cryptographic hash function by Austin Appleby.
The code is taken from the upstream and is in the public domain.

OK christos@
2012-07-08 01:21:11 +00:00
drochner 50ea67a5eb As discussed back in June, remove hmac_sha1 and hmac_md5 from libc, to
reduce bloat and namespace trouble. (both were never public; hmac_sha1
is moved to libcrypt now because it is used locally there)
2006-10-27 18:29:21 +00:00
elad b387889f76 Put public domain MD2 implementation in libc/hash/md2. 2005-09-24 20:51:14 +00:00
elad 767c8fdd86 Organize hashing in libc. 2005-09-24 19:04:52 +00:00
elad 7d818e4714 Compile SHA2 again. 2005-08-23 17:49:50 +00:00
elad 3dbf8d11de Not running lint on kernel code fooled me into thinking this was safe.
Don't compile SHA2 code until I resolve warnings.
2005-08-20 18:57:50 +00:00
elad 866f37de4e Add SHA2 hashing routines to userland.
At the moment there's only code for the init/transform/update/final
routines.

Man-page from OpenBSD.
2005-08-20 16:14:34 +00:00
sjg 3a0c68edfd Add support for SHA1 hashed passwords.
The algorithm used is essentially PBKDF1 from RFC 2898 but using
hmac_sha1 rather than SHA1 directly (suggested by smb@research.att.com).

 * The format of the encrypted password is:
 * $<tag>$<iterations>$<salt>$<digest>
 *
 * where:
 *      <tag>           is "sha1"
 *      <iterations>    is an unsigned int identifying how many rounds
 *                      have been applied to <digest>.  The number
 *                      should vary slightly for each password to make
 *                      it harder to generate a dictionary of
 *                      pre-computed hashes.  See crypt_sha1_iterations.
 *      <salt>          up to 64 bytes of random data, 8 bytes is
 *                      currently considered more than enough.
 *      <digest>        the hashed password.

hmac.c implementes HMAC as defined in RFC 2104 and includes a unit
test for both hmac_sha1 and hmac_sha1 using a selection of the Known
Answer Tests from RFC 2202.

It is worth noting that to be FIPS compliant the hmac key (password)
should be 10-20 chars.
2004-07-02 00:05:23 +00:00
cyber 6dbf0c76e9 fix typo: rmd160l.c -> rmd160hl.c 2000-07-05 16:10:36 +00:00
ad 90517b417b Pull in RIPEMD-160 functions from OpenBSD - this has the same API as our MD4,
MD5 and SHA1 stuff.
2000-07-05 11:44:01 +00:00
drochner a34eb7c1b7 use ${ARCHDIR} instead of ${.CURDIR}/arch/${MACHINE_ARCH} where appropriate
libc builds on pmax again
1999-02-24 15:05:20 +00:00
explorer b131132411 add sha1 functions, like md5/4 1999-02-04 05:08:58 +00:00