From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4153 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [Feature Request] SHA-1 HMAC Date: Fri, 25 Oct 2013 12:00:06 -0400 Message-ID: <20131025160006.GL20515@brightrain.aerifal.cx> References: 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 1382716819 18755 80.91.229.3 (25 Oct 2013 16:00:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Oct 2013 16:00:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4157-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 25 18:00:22 2013 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 1VZjoD-0002Ty-1h for gllmg-musl@plane.gmane.org; Fri, 25 Oct 2013 18:00:21 +0200 Original-Received: (qmail 22404 invoked by uid 550); 25 Oct 2013 16:00:20 -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 22393 invoked from network); 25 Oct 2013 16:00:20 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4153 Archived-At: On Fri, Oct 25, 2013 at 09:36:12AM -0600, Kyle Sanderson wrote: > Forgive my ignorance, but would it be possible to include SHA-1 HMAC into > musl? I'm not really sure if there's a list of functionality that's > prohibited from a libc; hopefully this is an acceptable request. I have a > single HMAC key that I use to sign multiple hashes with. I'm using > PolarSSL's implementation at the moment and I'd like to eliminate the > requirement. Hi. The conditions for something to go into libc are pretty stringent; otherwise, it would be called libeverything. :-) - Anything mandated by the current version of one of the relevant standards (ISO C or POSIX) goes in without question. - Things with major historical precedent or presence in obsolete standards are pretty sure to get included unless there's a strong reason against inclusion. - Modern BSD or GNU extensions that are widely used and not unreasonably costly to add generally get included. It sounds like what you're asking for is the addition of a new interface with no existing precedent, in which case, libc is really not the appropriate place for it. However, I think you can implement SHA-1 in just a few lines of code and include it with your project rather than depending on large libraries. Busybox has a very light, simple implementation you could copy; it's under GPLv2, but the code is by Rob Landley and I imagine he would relicense it under BSD/MIT for you if you need a less restrictive license. The original code it was based on was public domain, so you could also just go back to that. See libbb/hash_md5_sha.c in the Busybox source for details. Rich