-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with RustCrypto #2
base: master
Are you sure you want to change the base?
Conversation
balloon.go
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_block
function 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.