mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:45:49 +01:00
Add test for des_key_check_weak()
This commit is contained in:
parent
3fec220a33
commit
9ce7e8414a
@ -1,3 +1,15 @@
|
||||
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 )
|
||||
|
Loading…
Reference in New Issue
Block a user