Compatibility with RustCrypto#2
Conversation
| for left, right := 0, len(otherBytes)-1; left < right; left, right = left+1, right-1 { | ||
| otherBytes[left], otherBytes[right] = otherBytes[right], otherBytes[left] | ||
| } |
There was a problem hiding this comment.
math/big only takes big-endian, I copied this reverse slice implementation from here:
https://github.com/golang/go/wiki/SliceTricks#reversing
There was a problem hiding this comment.
I was messing around with this project and found out that there exists a function in math/big that takes little-endian.
I've submitted a pull request on your fork a while ago, but sadly I think this original repo has gotten stale. If there's more interest, I might spend some time to optimize the implementation.
There was a problem hiding this comment.
Just saw your comment here, sorry for the delay!
@nogoegst has to look at this PR, I really don't feel comfortable reviewing unsafe Go code.
@darenliang personally I have no stake in this library, I was only trying to help multiple Balloon implementations be compatible with each other, specifically the Rust library I contributed to. So if you are more interested in using Balloon with Go and want to have common compatibility, feel free to contact me.
|
Hi! |
|
I did try to replace the slice inversion. What I did was basically make a new slice with the |
Hi!
I'm currently working on an implementation of the Balloon hashing algorithm for the RustCrypto organization: RustCrypto/password-hashes#232. In an effort to make this viable, I am seeking to provide compatibility between different implementations.
Only two changes are required to provide compatibility:
ints_to_blockfunction was interpreted as hashing these values and produce a "block" of bytes; the prototype implementation uses some sort of encryption here, I merely replaced it with the hash already usedAny input is welcome! I added test-vectors to assure compatibility. I am willing to contribute a CI setup, just say the word!
I have never programmed in Go before!
Another library I provided compatibility for: nachonavarro/balloon-hashing#2
Addresses #1.