mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-26 23:14:07 +08:00
Improve info() function in cipher_aead_demo
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
64754e1b8d
commit
5e6c884315
@ -167,8 +167,9 @@ exit:
|
|||||||
*/
|
*/
|
||||||
static void aead_info( const mbedtls_cipher_context_t *ctx, size_t tag_len )
|
static void aead_info( const mbedtls_cipher_context_t *ctx, size_t tag_len )
|
||||||
{
|
{
|
||||||
// no convenient way to get the just cipher type (for example, AES)
|
mbedtls_cipher_type_t type = mbedtls_cipher_get_type( ctx );
|
||||||
const char *ciph = "???";
|
const mbedtls_cipher_info_t *info = mbedtls_cipher_info_from_type( type );
|
||||||
|
const char *ciph = mbedtls_cipher_info_get_name( info );
|
||||||
int key_bits = mbedtls_cipher_get_key_bitlen( ctx );
|
int key_bits = mbedtls_cipher_get_key_bitlen( ctx );
|
||||||
mbedtls_cipher_mode_t mode = mbedtls_cipher_get_cipher_mode( ctx );
|
mbedtls_cipher_mode_t mode = mbedtls_cipher_get_cipher_mode( ctx );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user