btstack_crypto: use auth_len for btstack_crypo_ccm_get_authentication_value

This commit is contained in:
Matthias Ringwald 2018-10-29 22:37:03 +01:00
parent 995faa292d
commit 10e0e23cd2
2 changed files with 3 additions and 3 deletions

View File

@ -1068,7 +1068,7 @@ void btstack_crypo_ccm_init(btstack_crypto_ccm_t * request, const uint8_t * key,
}
void btstack_crypo_ccm_get_authentication_value(btstack_crypto_ccm_t * request, uint8_t * authentication_value){
memcpy(authentication_value, request->x_i, 8);
memcpy(authentication_value, request->x_i, request->auth_len);
}
void btstack_crypto_ccm_encrypt_block(btstack_crypto_ccm_t * request, uint16_t block_len, const uint8_t * plaintext, uint8_t * ciphertext, void (* callback)(void * arg), void * callback_arg){

View File

@ -215,7 +215,7 @@ void btstack_crypto_ecc_p256_calculate_dhkey(btstack_crypto_ecc_p256_t * request
int btstack_crypto_ecc_p256_validate_public_key(const uint8_t * public_key);
/**
* Initialize Counter with CBC-MAC for Bluetooth Mesh (L=2,M=8)
* Initialize Counter with CBC-MAC for Bluetooth Mesh (L=2)
* @param request
* @param nonce
* @param key
@ -225,7 +225,7 @@ int btstack_crypto_ecc_p256_validate_public_key(const uint8_t * public_key);
void btstack_crypo_ccm_init(btstack_crypto_ccm_t * request, const uint8_t * key, const uint8_t * nonce, uint16_t message_len, uint8_t auth_len);
/**
* Get authentication value (M=8) after encrypt or decrypt operation
* Get authentication value after encrypt or decrypt operation
* @param request
* @param authentication_value
*/