-
Notifications
You must be signed in to change notification settings - Fork 16
Implement STB 34.101.77-2020 bash
#92
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
Conversation
newpavlov
left a comment
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.
The linked reference can not be downloaded right now (the server returns 500 for me and it was not cached by the wayback machine), so I can not read it.
|
After reading the spec, I am glad that its authors did not stubbornly use BE. Note that they explicitly wrote that they use the LE convention (section 4.2.2). In other words, IIUC when they write Granted, they could've used a bit less confusing notation here to better distinguish between hex-encoded byte sequences and integer literals, but at least the algorithm itself can be implemented efficiently. |
So we can use the |
Either this by using |
Thank you for the clarifying of that. That was the my most problem, when i've implemented all other Belarus national algorithms. |
newpavlov
left a comment
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.
Maybe we should use bash-f for the crate name instead of belt-bash?
This would be more consistent with bash-hash and bash-ae crate names for the higher-level algorithms (I am not sure about the prg suffix).
|
Also added benches, unroll loop inside
I was thinking about the name. I think you're right. |
|
Not bad performance at all :) test bash_hash256_10 ... bench: 13.52 ns/iter (+/- 0.47) = 769 MB/s
test bash_hash256_100 ... bench: 118.85 ns/iter (+/- 2.72) = 847 MB/s
test bash_hash256_1000 ... bench: 1,128.52 ns/iter (+/- 17.93) = 886 MB/s
test bash_hash256_10000 ... bench: 11,183.88 ns/iter (+/- 648.73) = 894 MB/s
test bash_hash384_10 ... bench: 16.94 ns/iter (+/- 0.52) = 625 MB/s
test bash_hash384_100 ... bench: 156.65 ns/iter (+/- 2.40) = 641 MB/s
test bash_hash384_1000 ... bench: 1,512.14 ns/iter (+/- 26.18) = 661 MB/s
test bash_hash384_10000 ... bench: 15,007.86 ns/iter (+/- 420.13) = 666 MB/s
test bash_hash512_10 ... bench: 24.37 ns/iter (+/- 1.17) = 416 MB/s
test bash_hash512_100 ... bench: 227.86 ns/iter (+/- 7.91) = 440 MB/s
test bash_hash512_1000 ... bench: 2,249.23 ns/iter (+/- 49.20) = 444 MB/s
test bash_hash512_10000 ... bench: 22,342.06 ns/iter (+/- 1,116.19) = 447 MB/sWaiting for merge and will PR for the hash. |
Implementation of
bash-sandbash-ffor AE256 and BashHash algorithms.