42 #define PAL_CRYPTO_AES_BLOCK_SIZE 16 44 #define PAL_CRYPTO_LL_KEY_LEN 16 45 #define PAL_CRYPTO_LL_IV_LEN 8 46 #define PAL_CRYPTO_LL_DATA_MIC_LEN 4 49 #define SEC_CCM_KEY_LEN 16 52 #define SEC_CCM_MAX_ADDITIONAL_LEN ((1<<16) - (1<<8)) 58 #define SEC_CCM_NONCE_LEN (15-SEC_CCM_L) 96 void PalCryptoInit(
void);
97 void PalCryptoDeInit(
void);
100 void PalCryptoGenerateP256KeyPair(
const uint8_t *pPrivKey, uint8_t *pPubKey);
101 void PalCryptoGenerateDhKey(
const uint8_t *pPubKey,
const uint8_t *pPrivKey, uint8_t *pDhKey);
102 bool_t PalCryptoValidatePublicKey(
const uint8_t *pPubKey, bool_t generateKey);
103 void PalCryptoGenerateRandomNumber(uint8_t *pBuf, uint8_t len);
106 uint32_t PalCryptoCcmDec(
const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen,
107 uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen,
108 uint8_t *pResult, uint8_t handlerId, uint16_t param, uint8_t event);
109 void PalCryptoCcmEnc(
const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen,
110 uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult,
111 uint8_t handlerId, uint16_t param, uint8_t event);
114 void PalCryptoAesEcb(
const uint8_t *pKey, uint8_t *pOut,
const uint8_t *pIn);
115 void PalCryptoAesCmac(
const uint8_t *pKey, uint8_t *pOut,
const uint8_t *pIn, uint16_t len);
116 void PalCryptoAesEnable(
PalCryptoEnc_t *pEnc, uint8_t
id, uint8_t localDir);
117 bool_t PalCryptoAesCcmEncrypt(
PalCryptoEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic);
118 bool_t PalCryptoAesCcmDecrypt(
PalCryptoEnc_t *pEnc, uint8_t *pBuf);
119 void PalCryptoSetEncryptPacketCount(
PalCryptoEnc_t *pEnc, uint64_t pktCnt);
120 void PalCryptoSetDecryptPacketCount(
PalCryptoEnc_t *pEnc, uint64_t pktCnt);
#define PAL_CRYPTO_LL_IV_LEN
#define PAL_CRYPTO_LL_KEY_LEN
Platform-independent data types.
PalCryptoState_t
Operational states.