New hash API: namespace

Jacob Carlborg doob at me.com
Mon Jun 25 06:30:10 PDT 2012


On 2012-06-25 12:24, Piotr Szturmaj wrote:
> Jonathan M Davis wrote:
>> On Monday, June 25, 2012 11:35:33 Johannes Pfau wrote:
>>> OK, so I understand std.util is probably not a good idea.
>>>
>>> So the candidates for the namespace are:
>>> * std.crypto.hash
>>> * std.checksum
>>> * std.crypto.hash and std.checksum
>>> * std.hash
>>>
>>> and the same with hash replaced by digest.
>>> So which one should we use?
>>
>> The previous discussions on this resulted in us going with std.hash.md5,
>> std.hash.sha1, and std.hash.crc32. I don't see any reason to change
>> that, and
>> crypto was specifically _not_ chosen, because crc32 isn't
>> cryptographically
>> sound. But std.hash encompasses things quite nicely, since they're all
>> hashes.
>
> IMHO crypto should be chosen because beside of hashes there are other
> cryptographic primitives (ciphers, PKI, MACs, etc.) and it would be nice
> to have them in one place. std.hash is too narrow because when std gets
> crypto there will be too many namespaces like std.ciphers, std.ssl,
> std.mac. All of them will nicely fit in std.crypto or similar.
>
> As you can see crypto isn't good candidate for checksums so another
> package std.checksum is proposed. Likewise mixing checksums and
> cryptographic hashes under one namespace (std.hash) isn't a right choice
> IMO.
>
> Having cryptographic primitives splitted to std.hash and std.crypto.*
> isn't a good choice either.

Can't we have two namespaces, one for checksums and one for the rest. Or 
one for cryptographically safe primitives and one for the rest.

Is there a general enough name to fit all these into one namespace?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list