From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1938 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl 0.9.5 release and new website Date: Sat, 15 Sep 2012 23:29:31 -0400 Message-ID: <20120916032931.GB254@brightrain.aerifal.cx> References: <20120915081227.GD27715@brightrain.aerifal.cx> <20120915135340.GI9428@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1347766694 8448 80.91.229.3 (16 Sep 2012 03:38:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Sep 2012 03:38:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1939-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 16 05:38:18 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TD5gW-0001x4-Rl for gllmg-musl@plane.gmane.org; Sun, 16 Sep 2012 05:38:16 +0200 Original-Received: (qmail 7726 invoked by uid 550); 16 Sep 2012 03:38:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7718 invoked from network); 16 Sep 2012 03:38:12 -0000 Content-Disposition: inline In-Reply-To: <20120915135340.GI9428@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1938 Archived-At: On Sat, Sep 15, 2012 at 03:53:41PM +0200, Szabolcs Nagy wrote: > > Post-release priorities are adding the last of the missing Linux > > syscalls, md5 crypt, and the long-elusive scheduling priority > > i attached an md5 crypt implementation > > i set the key limit to 30000 but that > can be lowered > > i'm not sure about the copyright notice in the middle > as the code was rewritten from scratch so nothing > was actually copied > but the old bsd code is the specification itself > and it is copyrighted: The license is 2-clause BSD so it doesn't really matter. > static uint32_t rol(uint32_t n, int k) { return (n << k) | (n >> (32-k)); } > #define F(x,y,z) (z ^ (x & (y ^ z))) > #define G(x,y,z) (y ^ (z & (y ^ x))) > #define H(x,y,z) (x ^ y ^ z) > #define I(x,y,z) (y ^ (x | ~z)) > #define FF(a,b,c,d,w,s,t) a += F(b,c,d) + w + t; a = rol(a,s) + b > #define GG(a,b,c,d,w,s,t) a += G(b,c,d) + w + t; a = rol(a,s) + b > #define HH(a,b,c,d,w,s,t) a += H(b,c,d) + w + t; a = rol(a,s) + b > #define II(a,b,c,d,w,s,t) a += I(b,c,d) + w + t; a = rol(a,s) + b > > [...] > static void processblock(struct md5 *s, const uint8_t *buf) > { > uint32_t i, W[16], a, b, c, d; > > for (i = 0; i < 16; i++) { > W[i] = buf[4*i]; > W[i] |= (uint32_t)buf[4*i+1]<<8; > W[i] |= (uint32_t)buf[4*i+2]<<16; > W[i] |= (uint32_t)buf[4*i+3]<<24; > } > > a = s->h[0]; > b = s->h[1]; > c = s->h[2]; > d = s->h[3]; > > i = 0; > while (i < 16) { > FF(a,b,c,d, W[i], 7, tab[i]); i++; > FF(d,a,b,c, W[i], 12, tab[i]); i++; > FF(c,d,a,b, W[i], 17, tab[i]); i++; > FF(b,c,d,a, W[i], 22, tab[i]); i++; > } This is more of the same old ugly manual unrolling. The file is small as-is, but I think it could be a lot smaller with -Os (and same speed as now with -O3) if the manual unrolling were removed. I'm going to commit as-is though so I can include it in 0.9.6 (see the other message I'm about to post). Rich