mbed TLS v2.2.0
ccm_alt.h
Go to the documentation of this file.
1 
21 #ifndef MBEDTLS_CCM_ALT_H
22 #define MBEDTLS_CCM_ALT_H
23 
24 #if !defined(MBEDTLS_CONFIG_FILE)
25 #include "config.h"
26 #else
27 #include MBEDTLS_CONFIG_FILE
28 #endif
29 
30 /***************************************************************************/
35 /***************************************************************************/
41 #if defined( MBEDTLS_CCM_ALT )
42 /* SiliconLabs CRYPTO hardware acceleration implementation */
43 
44 #include "aesdrv.h"
45 #include "sl_crypto.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
54 typedef struct
55 {
56  AESDRV_Context_t aesdrv_ctx;
57  unsigned int keybits;
58  uint32_t key[8];
59  mbedtls_device_io_mode io_mode;
60  mbedtls_device_io_mode_specific io_mode_specific;
62 }
64 
73 
92 int mbedtls_ccm_set_device_instance(mbedtls_ccm_context* ctx,
93  unsigned int devno);
94 
112 int mbedtls_ccm_set_device_lock_wait_ticks(mbedtls_ccm_context *ctx,
113  int ticks);
114 
140 int mbedtls_ccm_set_device_io_mode
141 (
142  mbedtls_ccm_context* ctx,
145  );
146 
158  mbedtls_cipher_id_t cipher,
159  const unsigned char *key,
160  unsigned int keybits );
161 
168 
194 int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length,
195  const unsigned char *iv, size_t iv_len,
196  const unsigned char *add, size_t add_len,
197  const unsigned char *input, unsigned char *output,
198  unsigned char *tag, size_t tag_len );
199 
217 int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
218  const unsigned char *iv, size_t iv_len,
219  const unsigned char *add, size_t add_len,
220  const unsigned char *input, unsigned char *output,
221  const unsigned char *tag, size_t tag_len );
222 
236 int mbedtls_ccm_encrypt_and_tag_ble( mbedtls_ccm_context *ctx,
237  unsigned char *data,
238  size_t length,
239  const unsigned char *iv,
240  unsigned char header,
241  unsigned char *tag );
242 
257 int mbedtls_ccm_auth_decrypt_ble( mbedtls_ccm_context *ctx,
258  unsigned char *data,
259  size_t length,
260  const unsigned char *iv,
261  unsigned char header,
262  unsigned char *tag );
263 
264 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
265 
270 int mbedtls_ccm_self_test( int verbose );
271 #endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
272 
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 #endif /* #if defined( MBEDTLS_CCM_ALT ) */
278 
282 #endif /* MBEDTLS_CCM_ALT_H */
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
CCM context structure.
Definition: ccm.h:46
Compatibility names (set of defines)
Definitions for AES based ciphers with CRYPTO hw acceleration.
mbedtls_cipher_id_t
Definition: cipher.h:68
int mbedtls_ccm_encrypt_and_tag(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len)
CCM buffer encryption.
int mbedtls_ccm_setkey(mbedtls_ccm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits)
CCM initialization (encryption and decryption)
int mbedtls_ccm_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len)
CCM buffer authenticated decryption.
mbedtls_device_io_mode
Enum defines which data I/O mode to use for moving data to/from the AES/CRYPTO hardware module...
Definition: sl_crypto.h:58
Silicon Labs specific mbedTLS defintitions.
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
Initialize CCM context (just makes references valid) Makes the context ready for mbedtls_ccm_setkey()...
Data I/O mode specific configuration structure.
Definition: sl_crypto.h:79