Test Specification for Hal Crypto Chibios Hal Crypto Test Suite. Test suite for ChibiOS Crypto Hal. The purpose of this suite is to perform unit tests on the Hal Crypto and to converge to 100% code coverage through successive improvements. cry_ > 8u ) | ( (v & 0xff000000) >> 24u ); } #endif void cryptoTest_setStream(BaseSequentialStream * s) { ts = s; } void cryptoTest_printArray(const uint8_t *a,size_t len) { #if CRYPTO_LOG_LEVEL == 1 for(size_t i=0;i Internal Tests AES ECB AES ECB #include "ref_aes.h" static const CRYConfig config_Polling = { TRANSFER_POLLING, AES_CFBS_128, //cfbs 0 }; static const CRYConfig config_DMA = { TRANSFER_DMA, AES_CFBS_128, //cfbs 0 }; ]]> AES ECB Polling testing AES ECB with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt AES ECB DMA testing AES ECB with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt Internal Tests AES CFB AES CFB #include "ref_aes.h" static const CRYConfig config_Polling = { TRANSFER_POLLING, AES_CFBS_128, //cfbs 0 }; static const CRYConfig config_DMA = { TRANSFER_DMA, AES_CFBS_128, //cfbs 0 }; ]]> AES CFB Polling testing AES CFB with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt AES CFB DMA testing AES CFB with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt Internal Tests AES CBC AES CBC #include "ref_aes.h" static const CRYConfig config_Polling = { TRANSFER_POLLING, AES_CFBS_128, //cfbs 0 }; static const CRYConfig config_DMA = { TRANSFER_DMA, AES_CFBS_128, //cfbs 0 }; ]]> AES CBC Polling testing AES CBC with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt AES CBC DMA testing AES CBC with various Keys loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt loading the key with 32 byte size Encrypt Decrypt Internal Tests (T)DES (T)DES testing #include "ref_des.h" static const CRYConfig configDES_Polling= { TRANSFER_POLLING, 0, TDES_ALGO_SINGLE }; static const CRYConfig configTDES_Polling= { TRANSFER_POLLING, 0, TDES_ALGO_TRIPLE }; static const CRYConfig configTDES_DMA= { TRANSFER_DMA, 0, TDES_ALGO_TRIPLE }; ]]> DES Polling testing DES in polled mode loading the key with 8 byte size Encrypt Decrypt TDES CBC Polling testing TDES CBC in polled mode loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt TDES ECB Polling testing TDES ECB in polling mode loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt TDES CBC DMA testing TDES CBC in polled mode loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt TDES ECB DMA testing TDES ECB in DMA mode loading the key with 16 byte size Encrypt Decrypt loading the key with 24 byte size Encrypt Decrypt Internal Tests TRNG TRNG testing static const CRYConfig configTRNG_Polling= { TRANSFER_POLLING, 0, 0 }; ]]> TRNG Polling testing TRNG in polled mode Random generation and test Internal Tests SHA SHA testing #include "ref_sha.h" #define MAX_DIGEST_SIZE_INBYTE 64 #define MAX_DIGEST_SIZE_INWORD (MAX_DIGEST_SIZE_INBYTE/4) static uint32_t digest[MAX_DIGEST_SIZE_INWORD]; static const CRYConfig configSHA_Polling= { TRANSFER_POLLING, 0, 0 }; ]]> SHA1 Polling testing SHA1 in polled mode Digest SHA256 Polling testing SHA256 in polled mode Digest SHA512 Polling testing SHA512 in polled mode Digest Internal Tests SHA SHA testing #include "ref_sha.h" #define MAX_DIGEST_SIZE_INBYTE 64 #define MAX_DIGEST_SIZE_INWORD (MAX_DIGEST_SIZE_INBYTE/4) static uint32_t digest[MAX_DIGEST_SIZE_INWORD]; static const CRYConfig configSHA_DMA= { TRANSFER_DMA, 0, 0 }; ]]> SHA1 DMA testing SHA1 in DMA mode Digest SHA256 DMA testing SHA256 in DMA mode Digest SHA512 DMA testing SHA512 in DMA mode Digest