#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 commented 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 commented 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!
這個拉請求可以自動合併。
Sign in to join this conversation.
未選擇標籤
未選擇里程碑
未指派成員
2 參與者
正在加載...
取消
保存
尚未有任何內容