Lines Matching refs:block_size
143 size_t olen, block_size; in cmac_generate_subkeys() local
147 block_size = ctx->cipher_info->block_size; in cmac_generate_subkeys()
150 if( ( ret = mbedtls_cipher_update( ctx, L, block_size, L, &olen ) ) != 0 ) in cmac_generate_subkeys()
156 if( ( ret = cmac_multiply_by_u( K1, L , block_size ) ) != 0 ) in cmac_generate_subkeys()
159 if( ( ret = cmac_multiply_by_u( K2, K1 , block_size ) ) != 0 ) in cmac_generate_subkeys()
170 const size_t block_size ) in cmac_xor_block() argument
174 for( index = 0; index < block_size; index++ ) in cmac_xor_block()
248 size_t olen, block_size; in mbedtls_cipher_cmac_update() local
255 block_size = ctx->cipher_info->block_size; in mbedtls_cipher_cmac_update()
261 ilen > block_size - 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()
269 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, 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()
281 n = ( ilen + block_size - 1 ) / block_size; in mbedtls_cipher_cmac_update()
286 cmac_xor_block( state, input, state, block_size ); in mbedtls_cipher_cmac_update()
288 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, in mbedtls_cipher_cmac_update()
292 ilen -= block_size; in mbedtls_cipher_cmac_update()
293 input += block_size; in mbedtls_cipher_cmac_update()
318 size_t olen, block_size; in mbedtls_cipher_cmac_finish() local
325 block_size = ctx->cipher_info->block_size; 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()
338 cmac_xor_block( M_last, M_last, K2, block_size ); in mbedtls_cipher_cmac_finish()
343 cmac_xor_block( M_last, last_block, K1, block_size ); in mbedtls_cipher_cmac_finish()
347 cmac_xor_block( state, M_last, state, block_size ); in mbedtls_cipher_cmac_finish()
348 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, in mbedtls_cipher_cmac_finish()
354 memcpy( output, state, block_size ); in mbedtls_cipher_cmac_finish()
724 int block_size, in cmac_test_subkeys() argument
773 if( ( ret = memcmp( K1, subkeys, block_size ) ) != 0 || in cmac_test_subkeys()
774 ( ret = memcmp( K2, &subkeys[block_size], block_size ) ) != 0 ) in cmac_test_subkeys()
805 int block_size, in cmac_test_wth_cipher() argument
833 if( ( ret = memcmp( output, &expected_result[i * block_size], block_size ) ) != 0 ) in cmac_test_wth_cipher()