#ifndef AES_CCM_ONEBLOCK_H
#define AES_CCM_ONEBLOCK_H

typedef unsigned char   u8;
typedef unsigned short u16;
typedef unsigned int   u32;
typedef unsigned int   u64;

typedef signed char             s8;
typedef signed short int        s16;
typedef signed int              s32;
typedef signed long long int    s64;

#define BLOCK_SIZE    16
#define KEY_SIZE      BLOCK_SIZE
#define NONCE_SIZE    12
#define MAC_SIZE      16

/*!
    @brief      AES128-CCM decryption for one block (128 bits)

    This function decrypts 16-byte payload encrypted by AES128-CCM.
    Also, it returns 16-byte MAC data that is calculated.

    @param[in]  key         AES128-CCM key.
    @param[in]  nonce       12-byte Nonce array.
    @param[out] pdata       16-byte Pdata array.
    @param[in]  cdata       16-byte Cdata array.
    @param[out]  mac         16-byte mac array.
    @return     none
 */
void SimpleCcmDecryptOneBlock(const u8 key[KEY_SIZE], const u8 nonce[NONCE_SIZE],
                              u8 pdata[BLOCK_SIZE], const u8 cdata[BLOCK_SIZE], u8 mac[MAC_SIZE] );

#endif /* AES_CCM_ONEBLOCK_H */
