[squeak-dev] [Vm-dev] SHA512 squeak implementation?

Levente Uzonyi leves at caesar.elte.hu
Sat Mar 7 10:20:11 UTC 2020

Hi Robert,

On Thu, 5 Mar 2020, Robert wrote:

> Oh yes, Levente, I recall speaking with you about it. I would like to
> make a proposal. Do you think you could fold all those hash functions,
> without the HA, into the Cryptography library? We have a HashFunction
> class in there, I do not know how different they may be in their public
> interface. I think it would be valuable to combine them. To support TLS
> 1.3, we would also need elliptical Diffie-Hellmans, I think.
> Levente, would you be willing to fold your work into Cryptography?

The reason why I created a separate package was that I found the 
Cryptography package too bloated. Cryptographic hash functions seem to be 
more commonly needed than ciphers, CSPRNGS, ASN1, etc.

It is possible to replace HashFunction and subclasses from Cryptography 
with those in Hasher, but there would be some consequences:
1) Hasher doesn't have MD2 or MD4, but those are obsolete and broken. I 
see little to no value rewriting them to satisfy Hasher's HashFunction 
requirements, but it shouldn't be too hard to do that.
2) the way instances are created differ. I didn't want to do it the way 
it's done in Cryptography's MD5, SHA1, SHA256, where class side #new may 
return an object that is not of that class but a subclass. So, I added 
instance creation methods to Hasher's HashFunction which return an 
instance optimized for the current platform. So, a few methods need to 
be changed in Cryptography to use the optimized hash functions.
3) Cryptography would depend on the Registers package.


> Kindly,
> Robert
> On 3/5/20 12:43 PM, Levente Uzonyi wrote:
>> Hi Robert,
>> The mail you are looking for is here:
>> http://lists.squeakfoundation.org/pipermail/vm-dev/2020-March/032986.html
>> Since that email, to make life easier to those who have the Cryptography
>> package loaded in their images, I've uploaded another variant of
>> Hasher: HAHasher. It's the same as the Hasher package but all class
>> names are prefixed with HA.
>> To load that, evaluate:
>> Installer ss
>>    	project: 'Registers';
>>    	install: 'Registers';
>>    	project: 'Hasher';
>>    	install: 'HAHasher'.
>> And then you can write
>> HAHashFunction newSHA512 hashMessage: 'test'.
>> Levente

More information about the Squeak-dev mailing list