-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add IDEA cipher #35
Add IDEA cipher #35
Conversation
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 some small notes when reading the code, haven't looked at the actual crypto yet.
idea/Cargo.toml
Outdated
|
||
[dependencies] | ||
block-cipher-trait = "0.5" | ||
opaque-debug = "0.1" |
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.
could you update these and match the latest definitions please?
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.
Done.
idea/src/lib.rs
Outdated
if i > 0 && i < 8 { | ||
m = 2; | ||
n = 1; | ||
} |
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.
this could be written more rust like as
let (m, n) = if i > 0 && i < 8 {
(2, 1)
} else {
(1, 2)
};
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.
You're right. It's corrected now.
Implementation of the IDEA cipher according to the original paper [1] and chapter 7 [2] of the "Handbook of Applied Cryptography".
The values used in the test of sub key generation can be found in [2] and the test vectors used to test encryption/decryption are coming from:
https://www.cosic.esat.kuleuven.be/nessie/testvectors/bc/idea/Idea-128-64.verified.test-vectors