tarequeh / DES

Implementation of Data Encryption Standard (DES) in C
http://www.codexn.com
MIT License
258 stars 140 forks source link

A bug in function generate_sub_keys #9

Open xiekch opened 4 years ago

xiekch commented 4 years ago

Hi, the code is well-written but I find a bug in the function generate_sub_keys. You don't initialize the key_sets before using it neither before calling the function. Thus the generated keys go wrong in my test. My suggestion is as follows. Just add memset(key_sets, 0, 17 * sizeof(key_set); in the top of the function.

xiekch commented 4 years ago

You initialized the first subkey but it is not enough

CreazyMouse commented 4 years ago

yes, befer generate_sub_keys should add memset(key_sets, 0, 17 * sizeof(key_set));

HelloTodayWolrd commented 1 year ago

yes, thank you

123yongming commented 1 year ago

Bravo!