#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!
该合并请求可以进行自动合并操作。
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。