Mirror of git://git.busybox.net/busybox with our patches on top
Source
md5_crypt(char result[MD5_OUT_BUFSIZE], const unsigned char *pw, const unsigned char *salt)
/*
* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
*
* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
* rights reserved.
*
* License to copy and use this software is granted provided that it
* is identified as the "RSA Data Security, Inc. MD5 Message-Digest
* Algorithm" in all material mentioning or referencing this software
* or this function.
*
* License is also granted to make and use derivative works provided
* that such works are identified as "derived from the RSA Data
* Security, Inc. MD5 Message-Digest Algorithm" in all material
* mentioning or referencing the derived work.
*
* RSA Data Security, Inc. makes no representations concerning either
* the merchantability of this software or the suitability of this
* software for any particular purpose. It is provided "as is"
* without express or implied warranty of any kind.
*
* These notices must be retained in any copies of any part of this
* documentation and/or software.
*
* $FreeBSD: src/lib/libmd/md5c.c,v 1.9.2.1 1999/08/29 14:57:12 peter Exp $
*
* This code is the same as the code published by RSA Inc. It has been
* edited for clarity and style only.
*
* ----------------------------------------------------------------------------
* The md5_crypt() function was taken from freeBSD's libcrypt and contains
* this license:
* "THE BEER-WARE LICENSE" (Revision 42):
* <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
*
* $FreeBSD: src/lib/libcrypt/crypt.c,v 1.7.2.1 1999/08/29 14:56:33 peter Exp $
*
* ----------------------------------------------------------------------------
* On April 19th, 2001 md5_crypt() was modified to make it reentrant
* by Erik Andersen <andersen@uclibc.org>
*
*
* June 28, 2001 Manuel Novoa III
*
* "Un-inlined" code using loops and static const tables in order to
* reduce generated code size (on i386 from approx 4k to approx 2.5k).
*
* June 29, 2001 Manuel Novoa III
*
* Completely removed static PADDING array.
*
* Reintroduced the loop unrolling in MD5_Transform and added the
* MD5_SIZE_OVER_SPEED option for configurability. Define below as:
* 0 fully unrolled loops
* 1 partially unrolled (4 ops per loop)
* 2 no unrolling -- introduces the need to swap 4 variables (slow)
* 3 no unrolling and all 4 loops merged into one with switch
* in each loop (glacial)
* On i386, sizes are roughly (-Os -fno-builtin):
* 0: 3k 1: 2.5k 2: 2.2k 3: 2k
*