Lines Matching refs:cmac_ctx

206     mbedtls_cmac_context_t *cmac_ctx;  in mbedtls_cipher_cmac_starts()  local
231 cmac_ctx = mbedtls_calloc( 1, sizeof( mbedtls_cmac_context_t ) ); in mbedtls_cipher_cmac_starts()
232 if( cmac_ctx == NULL ) in mbedtls_cipher_cmac_starts()
235 ctx->cmac_ctx = cmac_ctx; in mbedtls_cipher_cmac_starts()
237 mbedtls_zeroize( cmac_ctx->state, sizeof( cmac_ctx->state ) ); in mbedtls_cipher_cmac_starts()
245 mbedtls_cmac_context_t* cmac_ctx; in mbedtls_cipher_cmac_update() local
251 ctx->cmac_ctx == NULL ) in mbedtls_cipher_cmac_update()
254 cmac_ctx = ctx->cmac_ctx; in mbedtls_cipher_cmac_update()
256 state = ctx->cmac_ctx->state; in mbedtls_cipher_cmac_update()
260 if( cmac_ctx->unprocessed_len > 0 && in mbedtls_cipher_cmac_update()
261 ilen > block_size - cmac_ctx->unprocessed_len ) in mbedtls_cipher_cmac_update()
263 memcpy( &cmac_ctx->unprocessed_block[cmac_ctx->unprocessed_len], in mbedtls_cipher_cmac_update()
265 block_size - cmac_ctx->unprocessed_len ); in mbedtls_cipher_cmac_update()
267 cmac_xor_block( state, cmac_ctx->unprocessed_block, state, block_size ); in mbedtls_cipher_cmac_update()
275 input += block_size - cmac_ctx->unprocessed_len; in mbedtls_cipher_cmac_update()
276 ilen -= block_size - cmac_ctx->unprocessed_len; in mbedtls_cipher_cmac_update()
277 cmac_ctx->unprocessed_len = 0; in mbedtls_cipher_cmac_update()
299 memcpy( &cmac_ctx->unprocessed_block[cmac_ctx->unprocessed_len], in mbedtls_cipher_cmac_update()
302 cmac_ctx->unprocessed_len += ilen; in mbedtls_cipher_cmac_update()
312 mbedtls_cmac_context_t* cmac_ctx; in mbedtls_cipher_cmac_finish() local
320 if( ctx == NULL || ctx->cipher_info == NULL || ctx->cmac_ctx == NULL || in mbedtls_cipher_cmac_finish()
324 cmac_ctx = ctx->cmac_ctx; in mbedtls_cipher_cmac_finish()
326 state = cmac_ctx->state; in mbedtls_cipher_cmac_finish()
332 last_block = cmac_ctx->unprocessed_block; in mbedtls_cipher_cmac_finish()
335 if( cmac_ctx->unprocessed_len < block_size ) in mbedtls_cipher_cmac_finish()
337 cmac_pad( M_last, block_size, last_block, cmac_ctx->unprocessed_len ); in mbedtls_cipher_cmac_finish()
362 cmac_ctx->unprocessed_len = 0; in mbedtls_cipher_cmac_finish()
363 mbedtls_zeroize( cmac_ctx->unprocessed_block, in mbedtls_cipher_cmac_finish()
364 sizeof( cmac_ctx->unprocessed_block ) ); in mbedtls_cipher_cmac_finish()
372 mbedtls_cmac_context_t* cmac_ctx; in mbedtls_cipher_cmac_reset() local
374 if( ctx == NULL || ctx->cipher_info == NULL || ctx->cmac_ctx == NULL ) in mbedtls_cipher_cmac_reset()
377 cmac_ctx = ctx->cmac_ctx; in mbedtls_cipher_cmac_reset()
380 cmac_ctx->unprocessed_len = 0; in mbedtls_cipher_cmac_reset()
381 mbedtls_zeroize( cmac_ctx->unprocessed_block, in mbedtls_cipher_cmac_reset()
382 sizeof( cmac_ctx->unprocessed_block ) ); in mbedtls_cipher_cmac_reset()
383 mbedtls_zeroize( cmac_ctx->state, in mbedtls_cipher_cmac_reset()
384 sizeof( cmac_ctx->state ) ); in mbedtls_cipher_cmac_reset()