blob: 7137a60292cb5cca03fd34541418ba82f35abae9 [file] [log] [blame]
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001/* BEGIN_HEADER */
2#include <polarssl/ccm.h>
3/* END_HEADER */
4
5/* BEGIN_DEPENDENCIES
6 * depends_on:POLARSSL_CCM_C
7 * END_DEPENDENCIES
8 */
9
10/* BEGIN_CASE depends_on:POLARSSL_SELF_TEST:POLARSSL_AES_C */
11void ccm_self_test( )
12{
13 TEST_ASSERT( ccm_self_test( 0 ) == 0 );
14}
15/* END_CASE */
Manuel Pégourié-Gonnard9fe0d132014-05-06 12:12:45 +020016
17/* BEGIN_CASE */
18void ccm_init( int cipher_id, int key_size, int result )
19{
20 ccm_context ctx;
21 unsigned char key[32];
22 int ret;
23
24 memset( key, 0x2A, sizeof( key ) );
25 TEST_ASSERT( (unsigned) key_size <= 8 * sizeof( key ) );
26
27 ret = ccm_init( &ctx, cipher_id, key, key_size );
28 TEST_ASSERT( ret == result );
29
30 ccm_free( &ctx );
31}
32/* END_CASE */