They are only to be used internally by the DWC UWB modules.
Functions | |
int | dwc_wusb_aes_encrypt (u8 *src, u8 *key, u8 *dst) |
Encrypts an array of bytes using the AES encryption engine. | |
void | dwc_wusb_cmf (u8 *key, u8 *nonce, char *label, u8 *bytes, int len, u8 *result) |
The CCM-MAC-FUNCTION described in section 6.5 of the WUSB spec. | |
void | dwc_wusb_prf (int prf_len, u8 *key, u8 *nonce, char *label, u8 *bytes, int len, u8 *result) |
The PRF function described in section 6.5 of the WUSB spec. | |
static void | dwc_wusb_prf_64 (u8 *key, u8 *nonce, char *label, u8 *bytes, int len, u8 *result) |
The PRF-64 function described in section 6.5 of the WUSB spec. | |
static void | dwc_wusb_prf_128 (u8 *key, u8 *nonce, char *label, u8 *bytes, int len, u8 *result) |
The PRF-128 function described in section 6.5 of the WUSB spec. | |
static void | dwc_wusb_prf_256 (u8 *key, u8 *nonce, char *label, u8 *bytes, int len, u8 *result) |
The PRF-256 function described in section 6.5 of the WUSB spec. | |
void | dwc_wusb_fill_ccm_nonce (uint16_t haddr, uint16_t daddr, uint8_t *tkid, uint8_t *nonce) |
Fills in CCM Nonce per the WUSB spec. | |
void | dwc_wusb_gen_nonce (uint16_t addr, uint8_t *nonce) |
Generates a 16-byte cryptographic-grade random number for the Host/Device Nonce. | |
void | dwc_wusb_gen_key (uint8_t *ccm_nonce, uint8_t *mk, uint8_t *hnonce, uint8_t *dnonce, uint8_t *kck, uint8_t *ptk) |
Generates the Session Key (PTK) and Key Confirmation Key (KCK) per the WUSB spec. | |
void | dwc_wusb_gen_mic (uint8_t *ccm_nonce, uint8_t *kck, uint8_t *data, uint8_t *mic) |
Generates the Message Integrity Code over the Handshake data per the WUSB spec. |
int dwc_wusb_aes_encrypt | ( | u8 * | src, | |
u8 * | key, | |||
u8 * | dst | |||
) |
Encrypts an array of bytes using the AES encryption engine.
If dst
== src
, then the bytes will be encrypted in-place.
void dwc_wusb_cmf | ( | u8 * | key, | |
u8 * | nonce, | |||
char * | label, | |||
u8 * | bytes, | |||
int | len, | |||
u8 * | result | |||
) |
The CCM-MAC-FUNCTION described in section 6.5 of the WUSB spec.
This function takes a data string and returns the encrypted CBC Counter-mode MIC.
key | The 128-bit symmetric key. | |
nonce | The CCM nonce. | |
label | The unique 14-byte ASCII text label. | |
bytes | The byte array to be encrypted. | |
len | Length of the byte array. | |
result | Byte array to receive the 8-byte encrypted MIC. |
void dwc_wusb_prf | ( | int | prf_len, | |
u8 * | key, | |||
u8 * | nonce, | |||
char * | label, | |||
u8 * | bytes, | |||
int | len, | |||
u8 * | result | |||
) |
The PRF function described in section 6.5 of the WUSB spec.
This function concatenates MIC values returned from dwc_cmf() to create a value of the requested length.
prf_len | Length of the PRF function in bits (64, 128, or 256). | |
key,nonce,label,bytes,len | Same as for dwc_cmf(). | |
result | Byte array to receive the result. |
static void dwc_wusb_prf_64 | ( | u8 * | key, | |
u8 * | nonce, | |||
char * | label, | |||
u8 * | bytes, | |||
int | len, | |||
u8 * | result | |||
) | [inline, static] |
The PRF-64 function described in section 6.5 of the WUSB spec.
key,nonce,label,bytes,len,result | Same as for dwc_prf(). |
static void dwc_wusb_prf_128 | ( | u8 * | key, | |
u8 * | nonce, | |||
char * | label, | |||
u8 * | bytes, | |||
int | len, | |||
u8 * | result | |||
) | [inline, static] |
The PRF-128 function described in section 6.5 of the WUSB spec.
key,nonce,label,bytes,len,result | Same as for dwc_prf(). |
static void dwc_wusb_prf_256 | ( | u8 * | key, | |
u8 * | nonce, | |||
char * | label, | |||
u8 * | bytes, | |||
int | len, | |||
u8 * | result | |||
) | [inline, static] |
The PRF-256 function described in section 6.5 of the WUSB spec.
key,nonce,label,bytes,len,result | Same as for dwc_prf(). |
void dwc_wusb_fill_ccm_nonce | ( | uint16_t | haddr, | |
uint16_t | daddr, | |||
uint8_t * | tkid, | |||
uint8_t * | nonce | |||
) |
Fills in CCM Nonce per the WUSB spec.
[in] | haddr | Host address. |
[in] | daddr | Device address. |
[in] | tkid | Session Key(PTK) identifier. |
[out] | nonce | Pointer to where the CCM Nonce output is to be written. |
void dwc_wusb_gen_nonce | ( | uint16_t | addr, | |
uint8_t * | nonce | |||
) |
Generates a 16-byte cryptographic-grade random number for the Host/Device Nonce.
void dwc_wusb_gen_key | ( | uint8_t * | ccm_nonce, | |
uint8_t * | mk, | |||
uint8_t * | hnonce, | |||
uint8_t * | dnonce, | |||
uint8_t * | kck, | |||
uint8_t * | ptk | |||
) |
Generates the Session Key (PTK) and Key Confirmation Key (KCK) per the WUSB spec.
[in] | ccm_nonce | Pointer to CCM Nonce. |
[in] | mk | Master Key to derive the session from |
[in] | hnonce | Pointer to Host Nonce. |
[in] | dnonce | Pointer to Device Nonce. |
[out] | kck | Pointer to where the KCK output is to be written. |
[out] | ptk | Pointer to where the PTK output is to be written. |
void dwc_wusb_gen_mic | ( | uint8_t * | ccm_nonce, | |
uint8_t * | kck, | |||
uint8_t * | data, | |||
uint8_t * | mic | |||
) |
Generates the Message Integrity Code over the Handshake data per the WUSB spec.
ccm_nonce | Pointer to CCM Nonce. | |
kck | Pointer to Key Confirmation Key. | |
data | Pointer to Handshake data to be checked. | |
mic | Pointer to where the MIC output is to be written. |