[Cuis-dev] Adding SHA-256

Juan Vuletich juan at jvuletich.org
Wed May 6 08:07:16 PDT 2020


Hi Philip,

Just merged your pull request. Thanks!

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich


On 5/3/2020 6:22 PM, Philip Bernhart via Cuis-dev wrote:
> Hi folks,
>
> I added an implementation of the SHA-256 algorithm which
> belongs to the SHA2 suite of hashing algorithms.
>
> Here is the pull request:
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/pull/166
>
> It has almost the form of the SHA1 implementation, besides that
> it doesn't use any special primitives for speed.
>
> What I have noticed is that the SHA1 implementation is a bit dated
> as it depends on the ThirtyTwoBitRegister, which tries to mimic a
> 32bit register (duh!) and which internally still uses two 16bit
> SmallIntegers to hold its high and low word. Currently a good
> amount of systems out there support 64bit and as the VM is running
> on them it has 64bit words and can hold 32bit in one SmallInteger.
>
> So this Register mechanism IMHO could be refactored and it should
> also be generalized to have a register implementation for variable
> sized registers.
>
> Why?
> 1. There are other hashing algorithms, which use 64bit registers, why
>     re-inventing the wheel for them?
>
> 2. A register data structure could be handy for implementing VMs
>
>
> Cheers,
> Philip



More information about the Cuis-dev mailing list