DSAPrims broken on 64-bit VM (3684)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

DSAPrims broken on 64-bit VM (3684)

Levente Uzonyi
 
Hi All,

As the subject says, the primitives work, but the SecureHashAlgorithmTests
fail, because the prims miscalculate the values. I guess this is another
integer type issue.

Levente
Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Nicolas Cellier
 
Hi Levente,
looking at code, my wild guess (but I did not try) is that #leftRotate:by: is incorrectly inlined...
The parameter should be cast to unsigned int (32 bits) otherwise extra bits will pollute the result.
Unfortunately, this method get inlined with sqInt argument which are 64bits long in 64bits version...
We really need to fix inlining.
I'll try with <inline: #never> if I have time to confirm/infirm the guess...




2016-05-13 13:07 GMT+02:00 Levente Uzonyi <[hidden email]>:

Hi All,

As the subject says, the primitives work, but the SecureHashAlgorithmTests fail, because the prims miscalculate the values. I guess this is another integer type issue.

Levente

Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Nicolas Cellier
 
SecureHashAlgorithmTests pass here on MacOSX 64 with DSAPrims module and <inline: #never> in #leftRotate:by:
Now it remains to fix inlining...

2016-05-13 19:31 GMT+02:00 Nicolas Cellier <[hidden email]>:
Hi Levente,
looking at code, my wild guess (but I did not try) is that #leftRotate:by: is incorrectly inlined...
The parameter should be cast to unsigned int (32 bits) otherwise extra bits will pollute the result.
Unfortunately, this method get inlined with sqInt argument which are 64bits long in 64bits version...
We really need to fix inlining.
I'll try with <inline: #never> if I have time to confirm/infirm the guess...




2016-05-13 13:07 GMT+02:00 Levente Uzonyi <[hidden email]>:

Hi All,

As the subject says, the primitives work, but the SecureHashAlgorithmTests fail, because the prims miscalculate the values. I guess this is another integer type issue.

Levente


Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Levente Uzonyi
 
I finally checked what actually had changed in the plugin code and I found
that it was unrelated to inlining. The only change was the declaration of
two constants as U instead of ULL[1].
So, I decided to add the correct type declarations and recompiled the
plugin, which seems to work for me; the image-side tests pass.
Unfortunately, I don't have access to the Cryptography repository, so I
uploaded the changes to my place[2].

Levente

[1] http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/src/plugins/DSAPrims/DSAPrims.c?r1=3672&r2=3689
[2] http://leves.web.elte.hu/squeak/CryptographyPlugins-ul.11.mcz
Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

David T. Lewis
 
Ron or Robert,

Could one of you please add Levente (squeaksource user 'UL') as developer
in the Cryptography repository? This is needed so that Levente can update
the plugin.

Thanks!

Dave

On Sun, Jun 05, 2016 at 03:30:00AM +0200, Levente Uzonyi wrote:

>
> I finally checked what actually had changed in the plugin code and I found
> that it was unrelated to inlining. The only change was the declaration of
> two constants as U instead of ULL[1].
> So, I decided to add the correct type declarations and recompiled the
> plugin, which seems to work for me; the image-side tests pass.
> Unfortunately, I don't have access to the Cryptography repository, so I
> uploaded the changes to my place[2].
>
> Levente
>
> [1]
> http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/src/plugins/DSAPrims/DSAPrims.c?r1=3672&r2=3689
> [2] http://leves.web.elte.hu/squeak/CryptographyPlugins-ul.11.mcz
Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Robert Withers
 
Alright, I've added him as dev. Levente, you should be able save your
work, now.

Rob

On 06/05/2016 12:55 PM, David T. Lewis wrote:

> Ron or Robert,
>
> Could one of you please add Levente (squeaksource user 'UL') as developer
> in the Cryptography repository? This is needed so that Levente can update
> the plugin.
>
> Thanks!
>
> Dave
>
> On Sun, Jun 05, 2016 at 03:30:00AM +0200, Levente Uzonyi wrote:
>> I finally checked what actually had changed in the plugin code and I found
>> that it was unrelated to inlining. The only change was the declaration of
>> two constants as U instead of ULL[1].
>> So, I decided to add the correct type declarations and recompiled the
>> plugin, which seems to work for me; the image-side tests pass.
>> Unfortunately, I don't have access to the Cryptography repository, so I
>> uploaded the changes to my place[2].
>>
>> Levente
>>
>> [1]
>> http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/src/plugins/DSAPrims/DSAPrims.c?r1=3672&r2=3689
>> [2] http://leves.web.elte.hu/squeak/CryptographyPlugins-ul.11.mcz

Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Levente Uzonyi
 
Thanks Rob and Dave! I've uploaded the file to the repository.

Levente

On Sun, 5 Jun 2016, Robert Withers wrote:

> Alright, I've added him as dev. Levente, you should be able save your work,
> now.
>
> Rob
>
> On 06/05/2016 12:55 PM, David T. Lewis wrote:
>> Ron or Robert,
>>
>> Could one of you please add Levente (squeaksource user 'UL') as developer
>> in the Cryptography repository? This is needed so that Levente can update
>> the plugin.
>>
>> Thanks!
>>
>> Dave
>>
>> On Sun, Jun 05, 2016 at 03:30:00AM +0200, Levente Uzonyi wrote:
>>> I finally checked what actually had changed in the plugin code and I found
>>> that it was unrelated to inlining. The only change was the declaration of
>>> two constants as U instead of ULL[1].
>>> So, I decided to add the correct type declarations and recompiled the
>>> plugin, which seems to work for me; the image-side tests pass.
>>> Unfortunately, I don't have access to the Cryptography repository, so I
>>> uploaded the changes to my place[2].
>>>
>>> Levente
>>>
>>> [1]
>>> http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/src/plugins/DSAPrims/DSAPrims.c?r1=3672&r2=3689
>>> [2] http://leves.web.elte.hu/squeak/CryptographyPlugins-ul.11.mcz
>
>
Reply | Threaded
Open this post in threaded view
|

Re: DSAPrims broken on 64-bit VM (3684)

Robert Withers
 
Thanks for looking after crypto, Levente! I wish I could tell you you'll
be getting your CryptoClubCard in the mail...

Best,
Rob

On 06/05/2016 02:09 PM, Levente Uzonyi wrote:

> Thanks Rob and Dave! I've uploaded the file to the repository.
>
> Levente
>
> On Sun, 5 Jun 2016, Robert Withers wrote:
>
>> Alright, I've added him as dev. Levente, you should be able save your
>> work, now.
>>
>> Rob
>>
>> On 06/05/2016 12:55 PM, David T. Lewis wrote:
>>> Ron or Robert,
>>>
>>> Could one of you please add Levente (squeaksource user 'UL') as
>>> developer
>>> in the Cryptography repository? This is needed so that Levente can
>>> update
>>> the plugin.
>>>
>>> Thanks!
>>>
>>> Dave
>>>
>>> On Sun, Jun 05, 2016 at 03:30:00AM +0200, Levente Uzonyi wrote:
>>>> I finally checked what actually had changed in the plugin code and
>>>> I found
>>>> that it was unrelated to inlining. The only change was the
>>>> declaration of
>>>> two constants as U instead of ULL[1].
>>>> So, I decided to add the correct type declarations and recompiled the
>>>> plugin, which seems to work for me; the image-side tests pass.
>>>> Unfortunately, I don't have access to the Cryptography repository,
>>>> so I
>>>> uploaded the changes to my place[2].
>>>>
>>>> Levente
>>>>
>>>> [1]
>>>> http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/src/plugins/DSAPrims/DSAPrims.c?r1=3672&r2=3689
>>>> [2] http://leves.web.elte.hu/squeak/CryptographyPlugins-ul.11.mcz
>>
>>