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

Twine Cipher is unfinished #2

Open
MiragePV opened this issue Sep 27, 2018 · 1 comment
Open

Twine Cipher is unfinished #2

MiragePV opened this issue Sep 27, 2018 · 1 comment

Comments

@MiragePV
Copy link

MiragePV commented Sep 27, 2018

Hello,

at Twine CIpher, I am looking at the specification ( https://pdfs.semanticscholar.org/26b9/d188fc506fb34247c57dc365547f961576d7.pdf ). At the top of page 4 there is algorithm of 80bit key schedule.
In your code you follow this algorithm very well, but I can't find the line 8 of algorithm in your code (bitwise Rot4 in WK_0 - WK_3). This should shift WK_3 to WK_2, WK_2 to WK_1, WK_1 to WK_0 and WK_0 to WK_3, but it isn't there.
I believe this step is missing and it should be at line 128 of your code. Am I right?
I didn't run your implementation, but I am quite sure it doesn't compute the same result as test vectors.

Also, 128bit key schedule is missing (I am working on it).

@MiragePV
Copy link
Author

MiragePV commented Sep 28, 2018

Add this to line 123 of your code (just under xoring with roundconst section):

temp_val = temp[0];
temp[0] = temp[1];
temp[1] = temp[2];
temp[2] = temp[3];
temp[3] = temp_val;

and it should work correctly.

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

No branches or pull requests

1 participant