nRF5 SDK for Thread v0.11.0
Macros | Functions
Crypto

This module includes cryptographic functions. More...

Macros

#define OT_CRYPTO_HMAC_SHA_HASH_SIZE   32
 Length of HMAC SHA (in bytes).
 

Functions

void otCryptoHmacSha256 (const uint8_t *aKey, uint16_t aKeyLength, const uint8_t *aBuf, uint16_t aBufLength, uint8_t *aHash)
 
void otCryptoAesCcm (const uint8_t *aKey, uint16_t aKeyLength, uint8_t aTagLength, const void *aNonce, uint8_t aNonceLength, const void *aHeader, uint32_t aHeaderLength, void *aPlainText, void *aCipherText, uint32_t aLength, bool aEncrypt, void *aTag)
 

Detailed Description

This module includes cryptographic functions.

Function Documentation

void otCryptoAesCcm ( const uint8_t *  aKey,
uint16_t  aKeyLength,
uint8_t  aTagLength,
const void *  aNonce,
uint8_t  aNonceLength,
const void *  aHeader,
uint32_t  aHeaderLength,
void *  aPlainText,
void *  aCipherText,
uint32_t  aLength,
bool  aEncrypt,
void *  aTag 
)

This method performs AES CCM computation.

Parameters
[in]aKeyA pointer to the key.
[in]aKeyLengthLength of the key in bytes.
[in]aTagLengthLength of tag in bytes.
[in]aNonceA pointer to the nonce.
[in]aNonceLengthLength of nonce in bytes.
[in]aHeaderA pointer to the header.
[in]aHeaderLengthLength of header in bytes.
[in,out]aPlainTextA pointer to the plaintext.
[in,out]aCipherTextA pointer to the ciphertext.
[in]aLengthPlaintext length in bytes.
[in]aEncrypttrue on encrypt and false on decrypt.
[out]aTagA pointer to the tag.
void otCryptoHmacSha256 ( const uint8_t *  aKey,
uint16_t  aKeyLength,
const uint8_t *  aBuf,
uint16_t  aBufLength,
uint8_t *  aHash 
)

This function performs HMAC computation.

Parameters
[in]aKeyA pointer to the key.
[in]aKeyLengthThe key length in bytes.
[in]aBufA pointer to the input buffer.
[in]aBufLengthThe length of aBuf in bytes.
[out]aHashA pointer to the output hash buffer.

Documentation feedback | Developer Zone | Subscribe | Updated