Closed kevingzhang closed 4 years ago
I fixed this on my own rust-hmac-sha256 fork and send a pull request
https://github.com/jedisct1/rust-hmac-sha256/pull/1/commits/76fd9d343fff970383ea0f640108a15b8b48fea7
I updated hmac-sha256 on my own fork of vrf-rs and it works well on RaspberryPi. Just online change to use my own hmac-sha256 here https://github.com/kevingzhang/vrf-rs/commit/37ae0e0688c0ae755ad7147e91eaf3b48068163c
Once the owner of hmac-sha256 accepted my PR, and update newer version, I would suggest you to update yours in Cargo.toml too , so that other ARM developers can benefit from my fix.
BTW, your VRF did great job. I am wondering if you plan to write a sortition function based on existing VRF as well?
Good catch! Thanks for creating the issue and finding the bug.
We just published a new release 0.2.2
with the updated version of hmac-sha256
.
That is precisely our main use case, in which the VRF is utilized for selecting comittees to perform certain tasks. In our case, if the VRF output falls below a given target, the peer is eligible to perform the task.
Here you can find the code in which this verification is made:
Sorry that we point out to a different repo but it was important for us to release the VRF as an independent library.
I checked the source code.
The bit shift cause problem on ARM CPU, but won't cause any problem on X86 ( I cannot reproduce this bug on my Mac).
I found some others have fix like this: https://github.com/sile/libflate/commit/337eb3c11d33721879754eb282d7bfc4714de042
From
to
I have not tried this in VRF code, but I would like to ask first
Thanks