mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-27 19:15:11 +00:00
Minor CMAC fixes for merge
This commit is contained in:
parent
0b21cdf7bc
commit
3d64431a33
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
/* mbed TLS feature support */
|
/* mbed TLS feature support */
|
||||||
#define MBEDTLS_AES_ROM_TABLES
|
#define MBEDTLS_AES_ROM_TABLES
|
||||||
|
#define MBEDTLS_CMAC_C
|
||||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||||
#define MBEDTLS_ECP_NIST_OPTIM
|
#define MBEDTLS_ECP_NIST_OPTIM
|
||||||
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||||
|
|
|
@ -77,6 +77,11 @@
|
||||||
#error "MBEDTLS_DHM_C defined, but not all prerequisites"
|
#error "MBEDTLS_DHM_C defined, but not all prerequisites"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_CMAC_C) && \
|
||||||
|
!defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_DES_C)
|
||||||
|
#error "MBEDTLS_CMAC_C defined, but not all prerequisites"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
|
#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
|
||||||
#error "MBEDTLS_ECDH_C defined, but not all prerequisites"
|
#error "MBEDTLS_ECDH_C defined, but not all prerequisites"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* \brief The CMAC Mode for Authentication
|
* \brief The CMAC Mode for Authentication
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
|
|
@ -1681,7 +1681,7 @@
|
||||||
* Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_DES_C
|
* Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_DES_C
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_CMAC_C
|
//#define MBEDTLS_CMAC_C
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MBEDTLS_CTR_DRBG_C
|
* \def MBEDTLS_CTR_DRBG_C
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* NIST SP800-38B compliant CMAC implementation
|
* \file cmac.c
|
||||||
|
* \brief NIST SP800-38B compliant CMAC implementation
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
@ -20,9 +21,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition of CMAC:
|
* References:
|
||||||
* http://csrc.nist.gov/publications/nistpubs/800-38B/SP_800-38B.pdf
|
* - CMAC: NIST SP 800-38B
|
||||||
* RFC 4493 "The AES-CMAC Algorithm"
|
* - CMAC PRF: RFC 4493
|
||||||
|
* - Additional test vectors: ISO/IEC 9797-1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||||
|
@ -202,7 +204,6 @@ void mbedtls_cmac_free( mbedtls_cmac_context *ctx )
|
||||||
{
|
{
|
||||||
int block_size;
|
int block_size;
|
||||||
block_size = ctx->cipher_ctx.cipher_info->block_size;
|
block_size = ctx->cipher_ctx.cipher_info->block_size;
|
||||||
|
|
||||||
mbedtls_cipher_free( &ctx->cipher_ctx );
|
mbedtls_cipher_free( &ctx->cipher_ctx );
|
||||||
|
|
||||||
if( ctx->K1 != NULL )
|
if( ctx->K1 != NULL )
|
||||||
|
|
Loading…
Reference in a new issue