mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:15:43 +01:00
- Made des_key_check_weak() conform to other functions in return values.
- Added documentation for des_key_check_weak() and des_key_check_key_parity()
This commit is contained in:
parent
c43e326dca
commit
73206954d4
@ -77,14 +77,17 @@ void des_key_set_parity( unsigned char key[DES_KEY_SIZE] );
|
|||||||
* a parity bit to allow verification.
|
* a parity bit to allow verification.
|
||||||
*
|
*
|
||||||
* \param key 8-byte secret key
|
* \param key 8-byte secret key
|
||||||
|
*
|
||||||
|
* \return 0 is parity was ok, 1 if parity was not correct.
|
||||||
*/
|
*/
|
||||||
int des_key_check_key_parity( const unsigned char key[DES_KEY_SIZE] );
|
int des_key_check_key_parity( const unsigned char key[DES_KEY_SIZE] );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Check that key is not a weak or semi-weak DES key
|
* \brief Check that key is not a weak or semi-weak DES key
|
||||||
*
|
*
|
||||||
* \param key 8-byte secret key
|
* \param key 8-byte secret key
|
||||||
|
*
|
||||||
|
* \resurn 0 if no weak key was found, 1 if a weak key was identified.
|
||||||
*/
|
*/
|
||||||
int des_key_check_weak( const unsigned char key[DES_KEY_SIZE] );
|
int des_key_check_weak( const unsigned char key[DES_KEY_SIZE] );
|
||||||
|
|
||||||
|
@ -371,9 +371,9 @@ int des_key_check_weak( const unsigned char key[DES_KEY_SIZE] )
|
|||||||
|
|
||||||
for( i = 0; i < WEAK_KEY_COUNT; i++ )
|
for( i = 0; i < WEAK_KEY_COUNT; i++ )
|
||||||
if( memcmp( weak_key_table[i], key, DES_KEY_SIZE) == 0)
|
if( memcmp( weak_key_table[i], key, DES_KEY_SIZE) == 0)
|
||||||
return( 0 );
|
|
||||||
|
|
||||||
return( 1 );
|
return( 1 );
|
||||||
|
|
||||||
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void des_setkey( unsigned long SK[32], const unsigned char key[DES_KEY_SIZE] )
|
static void des_setkey( unsigned long SK[32], const unsigned char key[DES_KEY_SIZE] )
|
||||||
|
Loading…
Reference in New Issue
Block a user