#1 Keccak 384 Hash Fix

باز‌کردن
Yorgyetson قصد ادغام 1 تغییر را از Yorgyetson/master به desktopd/master دارد

I am working on a project that required PHP SHA3 hashing and came across this repo.

I ended up using it in my project, which is a PHP implementation of Kerl: https://github.com/iotaledger/kerl/blob/master/IOTA-Kerl-spec.md

My project can be found here: https://gitlab.com/YorgYetson/Kerl-PHP

While I was working on this, I found that the SHA3.php file needed to be modified in order to get Keccak 384 hashing to work properly. I'm not sure if this is an older spec for Keccak or just a typo.

I am working on a project that required PHP SHA3 hashing and came across this repo. I ended up using it in my project, which is a PHP implementation of Kerl: https://github.com/iotaledger/kerl/blob/master/IOTA-Kerl-spec.md My project can be found here: https://gitlab.com/YorgYetson/Kerl-PHP While I was working on this, I found that the SHA3.php file needed to be modified in order to get Keccak 384 hashing to work properly. I'm not sure if this is an older spec for Keccak or just a typo.
platform نظر 6 سال پیش
مالک

Because this change actually breaks consistency with the SHA-3 reference, I feel Kerl is just using another (possibly older) instance of Keccak. I've made changes to export the internal constructor, so please try this:

$sponge = new SHA3 (832, 768, 0x01, 48);

or namespaced optimized version (recommended, PHP 5.3+) under namespaced/desktopd/SHA3:

$sponge = new desktopd\SHA3\Sponge (832, 768, 0x01, 48);

If you find any new information, please notify me so I can make necessary changes.

Because this change actually breaks consistency with the SHA-3 reference, I feel Kerl is just using another (possibly older) instance of Keccak. I've made changes to export the internal constructor, so please try this: $sponge = new SHA3 (832, 768, 0x01, 48); or namespaced optimized version (**recommended**, PHP 5.3+) under `namespaced/desktopd/SHA3`: $sponge = new desktopd\SHA3\Sponge (832, 768, 0x01, 48); If you find any new information, please notify me so I can make necessary changes.
Yorgyetson نظر 6 سال پیش
نویسنده

Wow, very cool! Thank you for the quick response!

I think this is a great solution.

I'll give the sponge update a shot and let you know if it gives me any trouble.

I noticed that the python module Kerl uses for SHA3 the 0x01 value, that's actually how I figured out to change this one in the first place. Although, they also have a different value for byte size(?) so I really don't know what is going on.

https://github.com/tiran/pysha3/blob/5cbf015fb1fa5d8b6a61fb9187bf59739118d5ee/Modules/_sha3/sha3module.c#L210

The repo is fairly active, but maybe they just use the old spec too?

Any way you slice it your solution should work for what I need, so thanks again!

Wow, very cool! Thank you for the quick response! I think this is a great solution. I'll give the sponge update a shot and let you know if it gives me any trouble. I noticed that the python module Kerl uses for SHA3 the 0x01 value, that's actually how I figured out to change this one in the first place. Although, they also have a different value for byte size(?) so I really don't know what is going on. https://github.com/tiran/pysha3/blob/5cbf015fb1fa5d8b6a61fb9187bf59739118d5ee/Modules/_sha3/sha3module.c#L210 The repo is fairly active, but maybe they just use the old spec too? Any way you slice it your solution should work for what I need, so thanks again!
این pull request می تواند به صورت خودکار ادغام شود.
برای پیوستن به گفتگو، وارد شودید.
بدون برچسب
بدون نقطه عطف
بدون مسئول رسیدگی
2 مشارکت کننده
درحال بارگذاری...
لغو
ذخيره
هنوز محتوایی ایجاد نشده.