Commit 9ce7e841 authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Add test for des_key_check_weak()

parent 3fec220a
DES check weak key #1
des_check_weak:"0101010101010101":1
DES check weak key #2
des_check_weak:"FEE0FEE0FEF1FEF1":1
DES check weak key #3
des_check_weak:"0101010101010100":0
DES check weak key #4
des_check_weak:"EEE0FEE0FEF1FEF1":0
DES Encrypt OpenSSL Test Vector #1
des_encrypt_ecb:"0000000000000000":"0000000000000000":"8CA64DE9C1B123A7"
......
......@@ -7,6 +7,19 @@
* END_DEPENDENCIES
*/
/* BEGIN_CASE */
void des_check_weak( char *key_hex, int ret )
{
unsigned char key[DES_KEY_SIZE];
memset( key, 0, sizeof key );
unhexify( key, key_hex );
TEST_ASSERT( des_key_check_weak( key ) == ret );
}
/* END_CASE */
/* BEGIN_CASE */
void des_encrypt_ecb( char *hex_key_string, char *hex_src_string,
char *hex_dst_string )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment