<div dir="ltr">Hi Levente,<br><br>> >    HashFunction newSHA256<br>> ><br>> > instead of<br>> ><br>> >    SHA256 new<br>> ><br>> > in order to take advantage of Levente's plugin.<br>><br>> That is indeed some sort of a change but it only affects those who<br>> compiled the SHA256Plugin themselves since that plugin wasn't shipped with<br>> the VM.<br><br>Ah, you're speaking about legacy code.  I really hope we can include your plugin in future VM's.  Are Eliot, <i>et al</i>, on board?<div><div><div><br>> I decided against the practice of making #new return an instance of<br>> another class than the receiver, as it was with the previous<br>> implementation, because that makes it a lot harder for others to<br>> understand the code.<br></div></div></div><div><br></div><div>Hm.  I sort of agree, although I guess <i>Factory</i> is a recognized pattern.  To me, the issue is that writing</div><div><br></div><div>      "SHA256 new"</div><div><br></div><div>, is a perfectly intuitive and obvious way to use it, but sticking out like a sore thumb as a <b>subversively-wrong-way</b> to-use-it.  It'd be better if it threw an error, and even better than that if it just worked.</div><div><br></div><div>I know you care about the <i>quantity</i> of methods in the image (as do I), how about <i>quality</i>?  Can SHA256 #new be improved by doing essentially what HashFunction #newSHA256 does, and simply sending some alternative to new (i.e., basicNew initialize) to avoid the recursion?</div><div><br></div><div>Above, you mentioned you decided against the practice, does that mean you're writing:</div><div><br></div><div>     SHA256 newSHA256</div><div><br></div><div>?  If not, how did you do it?</div><div><br></div><div>Thanks again for this great work.</div><div><br></div><div> - Chris</div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 19, 2020 at 9:55 PM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu">leves@caesar.elte.hu</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">Hi Chris,<br>
<br>
On Sun, 19 Jul 2020, Chris Muller wrote:<br>
<br>
> Hi Robert and Levente,<br>
><br>
> Yes, I *think* so!  I'm just now getting up to speed after reading<br>
> that epic thread between you and Levente (subject line: "SHA512 squeak<br>
> implementation").  Thanks a ton to both of you, BTW, for this work!<br>
><br>
> After loading<br>
><br>
>       ProCrypto-1-1-1<br>
> and ProCryptoTests-1-1-1,<br>
><br>
> all 205 tests are passing, however, it took me a bit to realize I need to use<br>
><br>
>    HashFunction newSHA256<br>
><br>
> instead of<br>
><br>
>    SHA256 new<br>
><br>
> in order to take advantage of Levente's plugin.  This is great, thanks again!<br>
<br>
That is indeed some sort of a change but it only affects those who <br>
compiled the SHA256Plugin themselves since that plugin wasn't shipped with <br>
the VM.<br>
I decided against the practice of making #new return an instance of <br>
another class than the receiver, as it was with the previous <br>
implementation, because that makes it a lot harder for others to <br>
understand the code.<br>
<br>
><br>
> Quick side question:  Is it okay to reuse a SHA256 instance, or should<br>
> I just create a new one for each and every message to hash?<br>
<br>
All subinstances of HashFunction are reusable. The tests <br>
(see HashFunctionTest) do exactly that.<br>
<br>
<br>
Levente<br>
<br>
><br>
> Best,<br>
>  Chris<br>
><br>
><br>
> On Sat, Jul 18, 2020 at 6:02 AM Robert Withers <<a href="mailto:robert.withers@pm.me" target="_blank">robert.withers@pm.me</a>> wrote:<br>
>><br>
>> Hey Chris,<br>
>><br>
>> Did this approach fix your issues?<br>
>><br>
>> Kindly,<br>
>> rabbit<br>
>><br>
>> On 7/13/20 11:46 PM, Robert wrote:<br>
>><br>
>> Hi Chris,<br>
>><br>
>> You should only need to run #3, which will load Registers. Hasher was from before we integrated the code into ProCrypto-1-1-1.<br>
>><br>
>> Installer as project: ‘Cryptography’; install: ‘ProCrypto-1-1-1’.<br>
>><br>
>> Then to load tests run:<br>
>><br>
>> Installer as project: ‘Cryptography’; install: ‘ProCryptoTests-1-1-1’.<br>
>><br>
>> Let us know if any tests fail and we can look into it.<br>
>><br>
>> Kindly,<br>
>> Robert<br>
>><br>
>><br>
>> On Mon, Jul 13, 2020 at 19:52, Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>> wrote:<br>
>><br>
>> Hi Robert, hi Levente,<br>
>><br>
>> I would like to utilize the latest crypto in my next project, would<br>
>> you help me with the current proper way to configure my image, and my<br>
>> vm with plugins?<br>
>><br>
>> (image)<br>
>> In going back through some recent messages on the mailing lists and<br>
>> instructions on <a href="http://squeaksource.com" rel="noreferrer" target="_blank">squeaksource.com</a>, I came across these incantations as<br>
>> current ways to load the image code:<br>
>><br>
>> 1) Installer ss<br>
>> project: 'Registers';<br>
>> install: 'Registers';<br>
>> project: 'Hasher';<br>
>> install: 'HAHasher-Core';<br>
>> install: 'HAHasher-Tests'.<br>
>><br>
>> 2) Installer ss<br>
>> project: 'Registers';<br>
>> install: 'Registers';<br>
>> project: 'Hasher';<br>
>> install: 'HAHasher'.<br>
>><br>
>> 3) Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'.<br>
>><br>
>> I like these one-click-for-everything scripts for crypto -- it<br>
>> satisfies the good use-case of development and education, and also<br>
>> knowing all what's available to Squeak in one glance. My app's build<br>
>> script can cherry pick what it needs, but any advice on which starting<br>
>> point above or otherwise is appreciated.<br>
>><br>
>> (vm)<br>
>> I put the SHA2Plugin.so from Roberts dropbox in the lib directory,<br>
>> and it shows up as a "Loaded VM Module" in About Squeak. But, three<br>
>> of the "WithPluginTest"'s are failing. My OS is linux_x64. I don't<br>
>> know how to build Squeak or plugins from sources, but including it in<br>
>> the standard precompiled vm would be so pertinent for Squeak today,<br>
>> IMO. SHA256 is one of the ones I'm going to need, so would be nice to<br>
>> have it work via plugin. I assume it's a lot faster?<br>
>><br>
>> Thanks,<br>
>> Chris<br>
>><br>
>> On Tue, Mar 10, 2020 at 3:52 PM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br>
>>><br>
>>><br>
>>> Hi Robert,<br>
>>><br>
>>> With yesterday's help from Eliot and Nicolas, the SHA2Plugin is ready:<br>
>>> <a href="http://squeaksource.com/Cryptography/CryptographyPlugins-ul.19.mcz" rel="noreferrer" target="_blank">http://squeaksource.com/Cryptography/CryptographyPlugins-ul.19.mcz</a><br>
>>> The updated version of the image-side code is available in the Hasher<br>
>>> repository. You can install it with:<br>
>>><br>
>>> Installer ss<br>
>>> project: 'Registers';<br>
>>> install: 'Registers';<br>
>>> project: 'Hasher';<br>
>>> install: 'HAHasher-Core';<br>
>>> install: 'HAHasher-Tests'.<br>
>>><br>
>>><br>
>>> Levente<br>
>>><br>
>>><br>
>>> On Tue, 10 Mar 2020, Levente Uzonyi wrote:<br>
>>><br>
>>>><br>
>>>> Hi Robert,<br>
>>>><br>
>>>> Please have a look at:<br>
>>>> <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-March/207851.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-March/207851.html</a><br>
>>>> It answers all your questions.<br>
>>>><br>
>>>><br>
>>>> Levente<br>
>>>><br>
>>>> On Tue, 10 Mar 2020, Robert wrote:<br>
>>>><br>
>>>>> Hi Levente,<br>
>>>>><br>
>>>>> I got the SHA2Plugin built and deployed to my Crypto plugins folder. Now I<br>
>>>> am trying to figure out how to call it from SHA512.<br>
>>>>><br>
>>>>> <a href="https://www.dropbox.com/sh/yhv253rwrhq0q5p/AAB7PKP2KPiGpDnIyule2h_Ia?dl=0" rel="noreferrer" target="_blank">https://www.dropbox.com/sh/yhv253rwrhq0q5p/AAB7PKP2KPiGpDnIyule2h_Ia?dl=0</a><br>
>>>>><br>
>>>>> [plugin] I looked at it and please understand I think the classes you wrote<br>
>>>> and the framework is really quite nice. I am thrilled we found SHA512! It's<br>
>>>> impressive that your one plugin can handle a number of hash functions!<br>
>>>>> Now all I need is to find the code that calls the SHA2Plugin. Levente,<br>
>>>> would you share that code, please?<br>
>>>>><br>
>>>>> Kindly,<br>
>>>>> Robert<br>
>>>>><br>
>>>>><br>
>>>><br>
>><br>
>><br>
>><br>
></blockquote></div>