mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Remove MBEDTLS_DES_SETKEY_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
3ab1b2d00b
commit
43874e0a84
@ -350,7 +350,6 @@
|
|||||||
*/
|
*/
|
||||||
//#define MBEDTLS_TIMING_ALT
|
//#define MBEDTLS_TIMING_ALT
|
||||||
|
|
||||||
//#define MBEDTLS_DES_SETKEY_ALT
|
|
||||||
//#define MBEDTLS_DES_CRYPT_ECB_ALT
|
//#define MBEDTLS_DES_CRYPT_ECB_ALT
|
||||||
//#define MBEDTLS_DES3_CRYPT_ECB_ALT
|
//#define MBEDTLS_DES3_CRYPT_ECB_ALT
|
||||||
//#define MBEDTLS_AES_SETKEY_ENC_ALT
|
//#define MBEDTLS_AES_SETKEY_ENC_ALT
|
||||||
|
@ -344,21 +344,6 @@ int mbedtls_des3_crypt_cbc(mbedtls_des3_context *ctx,
|
|||||||
unsigned char *output);
|
unsigned char *output);
|
||||||
#endif /* MBEDTLS_CIPHER_MODE_CBC */
|
#endif /* MBEDTLS_CIPHER_MODE_CBC */
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Internal function for key expansion.
|
|
||||||
* (Only exposed to allow overriding it,
|
|
||||||
* see MBEDTLS_DES_SETKEY_ALT)
|
|
||||||
*
|
|
||||||
* \param SK Round keys
|
|
||||||
* \param key Base key
|
|
||||||
*
|
|
||||||
* \warning DES/3DES are considered weak ciphers and their use constitutes a
|
|
||||||
* security risk. We recommend considering stronger ciphers
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
void mbedtls_des_setkey(uint32_t SK[32],
|
|
||||||
const unsigned char key[MBEDTLS_DES_KEY_SIZE]);
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_SELF_TEST)
|
#if defined(MBEDTLS_SELF_TEST)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -389,8 +389,10 @@ int mbedtls_des_key_check_weak(const unsigned char key[MBEDTLS_DES_KEY_SIZE])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MBEDTLS_DES_SETKEY_ALT)
|
/*
|
||||||
void mbedtls_des_setkey(uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE])
|
* Internal function for key expansion.
|
||||||
|
*/
|
||||||
|
static void mbedtls_des_setkey(uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint32_t X, Y, T;
|
uint32_t X, Y, T;
|
||||||
@ -454,7 +456,6 @@ void mbedtls_des_setkey(uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY
|
|||||||
| ((Y << 2) & 0x00000004) | ((Y >> 21) & 0x00000002);
|
| ((Y << 2) & 0x00000004) | ((Y >> 21) & 0x00000002);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !MBEDTLS_DES_SETKEY_ALT */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DES key schedule (56-bit, encryption)
|
* DES key schedule (56-bit, encryption)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user