Re: [GENERAL] SHA1 on postgres 8.3

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] SHA1 on postgres 8.3
Date: 2008-01-21 08:08:38
Message-ID: e51f66da0801210008h55fa97f7g1968e1daaac2ce12@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 1/20/08, Greg Sabino Mullane <greg(at)turnstep(dot)com> wrote:
> In summary: what would objections be to my writing a sha1() patch?

Well.

If you do start adding hashes to core then _please_ pick a path
that allows having all the standard hashes in advance. That means
both md5 and sha-1, sha2 (4 hashes) and there is also sha-3 in the
horizon.

Basically there seems to be 2 variants:

1) Continue the md5() style: md5(), sha1(), sha224(), sha256(),
sha384(), sha512(), plus another 4 for SHA-3.

2) Move hashing functions from pgcrypto to core. That means
digest() and I would suggest hmac() and crypt() too.
I'm also starting to think it may be worth having hexdigest().

I prefer 2). There is some common infrastructure in pgcrypto,
the hash specific parts can be either split out or rewritten
from scratch, hashes need very small amount of code.

I agree that having all of pgcrypto in core is bit overkill,
so please don't think of it as all-or-nothing affair.

--
marko

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2008-01-21 08:10:43 Re: Sun acquires MySQL
Previous Message Florian Weimer 2008-01-21 07:53:14 Re: [GENERAL] SHA1 on postgres 8.3

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-01-21 10:38:40 Re: Bug in psql/enum
Previous Message Florian Weimer 2008-01-21 07:53:14 Re: [GENERAL] SHA1 on postgres 8.3