<div dir="ltr"><div dir="ltr">Philip,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 3, 2020 at 5:23 PM Philip Bernhart via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What I have noticed is that the SHA1 implementation is a bit dated<br>
as it depends on the ThirtyTwoBitRegister, which tries to mimic a<br>
32bit register (duh!) and which internally still uses two 16bit<br>
SmallIntegers to hold its high and low word. Currently a good<br>
amount of systems out there support 64bit and as the VM is running<br>
on them it has 64bit words and can hold 32bit in one SmallInteger.<br></blockquote><div><br></div><div>Keep in mind that there are a fair number of 32-bit VMs still in use esp. on ARM.  So ThirtyTwoBitRegister (or something like it) needs to stay in the mix for a (long) while though there could be a higher performance path on a 64-bit VM with a fallback to ThirtyTwoBitRegister on 32-bit.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So this Register mechanism IMHO could be refactored and it should<br>
also be generalized to have a register implementation for variable<br>
sized registers.<br></blockquote><div><br></div><div>Sure, as long as we don't assume that everyone is running on 64-bit systems.  So you'd want a solution that will scale both for the word size desired as well as the word size of the VM being run on.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Why?<br>
1. There are other hashing algorithms, which use 64bit registers, why<br>
   re-inventing the wheel for them?<br>
<br>
2. A register data structure could be handy for implementing VMs<br></blockquote><div><br></div><div>Makes sense to me.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Cheers,<br>
Philip<br><br></blockquote><div><br></div><div>Thanks,</div><div>Phil </div></div></div>