mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: crypto visibility
Date: Wed, 14 Jan 2015 17:22:59 -0500	[thread overview]
Message-ID: <20150114222259.GM4574@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAPLrYESiow2vYRAe1DoGhCJRtrV5bWVnerk+KSOFx40-XFKqoQ@mail.gmail.com>

On Wed, Jan 14, 2015 at 09:51:37AM +0100, Daniel Cegiełka wrote:
> Hi,
> Can we make these functions visible? They are very useful.
> 
> src/crypt/crypt_md5.c:
> void md5_init()
> void md5_sum()
> void md5_update()
> 
> src/crypt/crypt_sha256.c:
> void sha256_init()
> void sha256_sum()
> void sha256_update()
> 
> src/crypt/crypt_sha512.c:
> void sha512_init()
> void sha512_sum()
> void sha512_update()

In short, no, at least not without a lot of other things happening. To
do so would be to recreating one of the big things musl was designed
to get away from: random nonstandard interfaces with no documented
interface contract and behavior determined by whatever the existing
implementation(s) happened to do. Note that making these interfaces
public would also involve making the size and possibly representation
of the state structure a public API/ABI too.

If the code is good and you want to use it, the best way is copy and
paste. That way you avoid depending on any assumptions about an
interface contract because the code is all under your control. If you
think there would be interest in standardizing these functions, you
can pursue that with other implementations. It should involve properly
documenting the behavior including corner cases and reaching an
agreement.

Alternatively copies could just be put in a non-libc library like
libhash or something; this probably makes a lot of sense, as there's
nothing system-specific about how they're implemented.

Rich


  parent reply	other threads:[~2015-01-14 22:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14  8:51 Daniel Cegiełka
2015-01-14 17:58 ` Szabolcs Nagy
2015-01-14 22:22 ` Rich Felker [this message]
2015-01-15 21:17   ` Daniel Cegiełka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150114222259.GM4574@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).