-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat: implement CAST5 based on RFC 2144 #36
Conversation
@newpavlov any update on this? I would really like to get this up on crates.io, but the |
Ping @newpavlov I can also keep it in my own repo for now, but would really like to use the crate name, which is reserved by rustcrypto though |
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.
Thank you for you contribution and sorry for the long absence!
I will merge this PR and publish it after some minor changes.
45d1145
to
2fc1163
Compare
Thanks for the review @newpavlov I have implemented all the suggestions, except for the additional test vectors |
let (l, r) = if self.small_key { | ||
(l, r) | ||
} else { | ||
// Rounds 13..16 are only executed for keys > 80 bits. |
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.
Hm, I wonder if it'll be worth to introduce two structs Cast5
for 80-128 bit keys and SmallCast5
for 40-80 bit keys. Have you measured the performance impact of adding this branching?
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.
There was no noticeable difference in the benchmarks I ran for 128bit keys befor and after
@newpavlov should be ready |
Sorry again for delay! I will introduce some minor changes and will publish the crate! |
As described in https://tools.ietf.org/html/rfc2144
Test vectors are based on the RFC as well.
Benchmarks on my Macbook i9 2.7Ghz