qcacmn: Add support for GMAC MIC calculation

Add changes to calculate MIC using aead calls in linux

Change-Id: I710b1c748c36babc8e66aaf920a07f9657f6e273
CRs-Fixed: 2164910
This commit is contained in:
Padma, Santhosh Kumar
2017-12-18 16:29:05 +05:30
committed by snandini
父節點 b3c81ac057
當前提交 f5d592433f
共有 2 個文件被更改,包括 105 次插入2 次删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -47,6 +47,9 @@ extern "C" {
#define FIXED_PARAM_OFFSET_ASSOC_REQ 4
#define FIXED_PARAM_OFFSET_ASSOC_RSP 6
#define AAD_LEN 20
#define IEEE80211_MMIE_GMAC_MICLEN 16
#define IS_VALID_CTR_KEY_LEN(len) ((((len) == 16) || ((len) == 32) || \
((len) == 48)) ? 1 : 0)
@@ -136,6 +139,23 @@ int qdf_aes_s2v(const uint8_t *key, unsigned int key_len, const uint8_t *s[],
*/
int qdf_aes_ctr(const uint8_t *key, unsigned int key_len, uint8_t *siv,
const uint8_t *src, size_t src_len, uint8_t *dest, bool enc);
/**
* qdf_crypto_aes_gmac: This API calculates MIC for GMAC
* @key: key used for operation
* @key_length: key length
* @iv: Initialization vector
* @aad: Additional authentication data
* @data: Pointer to data
* @data_len: Length of data
* @mic: Pointer to MIC
*
* Return: 0 if success else Error number
*/
int qdf_crypto_aes_gmac(uint8_t *key, uint16_t key_length,
uint8_t *iv, uint8_t *aad, uint8_t *data,
uint16_t data_len, uint8_t *mic);
#ifdef __cplusplus
}
#endif /* __cplusplus */