Skip to content
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

Merged
merged 3 commits into from
May 24, 2020
Merged

Add IDEA cipher #35

merged 3 commits into from
May 24, 2020

Conversation

crodriguezvega
Copy link
Contributor

@crodriguezvega crodriguezvega commented Nov 3, 2018

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

Copy link
Member

@dignifiedquire dignifiedquire left a 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"
Copy link
Member

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?

Copy link
Contributor Author

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;
}
Copy link
Member

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)
};

Copy link
Contributor Author

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.

@tarcieri tarcieri merged commit e038667 into RustCrypto:master May 24, 2020
@newpavlov newpavlov mentioned this pull request Jun 8, 2020
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants