Lines Matching refs:ret

141     int ret;  in cmac_generate_subkeys()  local
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()
165 return( ret ); in cmac_generate_subkeys()
247 int n, j, ret = 0; in mbedtls_cipher_cmac_update() local
269 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, in mbedtls_cipher_cmac_update()
288 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, in mbedtls_cipher_cmac_update()
306 return( ret ); in mbedtls_cipher_cmac_update()
317 int ret; in mbedtls_cipher_cmac_finish() local
348 if( ( ret = mbedtls_cipher_update( ctx, state, block_size, state, in mbedtls_cipher_cmac_finish()
367 return( ret ); in mbedtls_cipher_cmac_finish()
395 int ret; in mbedtls_cipher_cmac() local
402 if( ( ret = mbedtls_cipher_setup( &ctx, cipher_info ) ) != 0 ) in mbedtls_cipher_cmac()
405 ret = mbedtls_cipher_cmac_starts( &ctx, key, keylen ); in mbedtls_cipher_cmac()
406 if( ret != 0 ) in mbedtls_cipher_cmac()
409 ret = mbedtls_cipher_cmac_update( &ctx, input, ilen ); in mbedtls_cipher_cmac()
410 if( ret != 0 ) in mbedtls_cipher_cmac()
413 ret = mbedtls_cipher_cmac_finish( &ctx, output ); in mbedtls_cipher_cmac()
418 return( ret ); in mbedtls_cipher_cmac()
429 int ret; in mbedtls_aes_cmac_prf_128() local
441 ret = MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE; in mbedtls_aes_cmac_prf_128()
454 ret = mbedtls_cipher_cmac( cipher_info, zero_key, 128, key, in mbedtls_aes_cmac_prf_128()
456 if( ret != 0 ) in mbedtls_aes_cmac_prf_128()
460 ret = mbedtls_cipher_cmac( cipher_info, int_key, 128, input, in_len, in mbedtls_aes_cmac_prf_128()
466 return( ret ); in mbedtls_aes_cmac_prf_128()
727 int i, ret; in cmac_test_subkeys() local
747 if( ( ret = mbedtls_cipher_setup( &ctx, cipher_info ) ) != 0 ) in cmac_test_subkeys()
755 if( ( ret = mbedtls_cipher_setkey( &ctx, key, keybits, in cmac_test_subkeys()
764 ret = cmac_generate_subkeys( &ctx, K1, K2 ); in cmac_test_subkeys()
765 if( ret != 0 ) in cmac_test_subkeys()
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()
794 return( ret ); in cmac_test_subkeys()
809 int i, ret; in cmac_test_wth_cipher() local
816 ret = MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE; in cmac_test_wth_cipher()
825 if( ( ret = mbedtls_cipher_cmac( cipher_info, key, keybits, messages, in cmac_test_wth_cipher()
833 if( ( ret = memcmp( output, &expected_result[i * block_size], block_size ) ) != 0 ) in cmac_test_wth_cipher()
845 return( ret ); in cmac_test_wth_cipher()
852 int ret; in test_aes128_cmac_prf() local
858 ret = mbedtls_aes_cmac_prf_128( PRFK, PRFKlen[i], PRFM, 20, output ); in test_aes128_cmac_prf()
859 if( ret != 0 || in test_aes128_cmac_prf()
866 return( ret ); in test_aes128_cmac_prf()
873 return( ret ); in test_aes128_cmac_prf()
879 int ret; in mbedtls_cmac_self_test() local
883 if( ( ret = cmac_test_subkeys( verbose, in mbedtls_cmac_self_test()
892 return( ret ); in mbedtls_cmac_self_test()
895 if( ( ret = cmac_test_wth_cipher( verbose, in mbedtls_cmac_self_test()
906 return( ret ); in mbedtls_cmac_self_test()
910 if( ( ret = cmac_test_subkeys( verbose, in mbedtls_cmac_self_test()
919 return( ret ); in mbedtls_cmac_self_test()
922 if( ( ret = cmac_test_wth_cipher( verbose, in mbedtls_cmac_self_test()
933 return( ret ); in mbedtls_cmac_self_test()
937 if( ( ret = cmac_test_subkeys( verbose, in mbedtls_cmac_self_test()
946 return( ret ); in mbedtls_cmac_self_test()
949 if( ( ret = cmac_test_wth_cipher ( verbose, in mbedtls_cmac_self_test()
960 return( ret ); in mbedtls_cmac_self_test()
966 if( ( ret = cmac_test_subkeys( verbose, in mbedtls_cmac_self_test()
975 return( ret ); in mbedtls_cmac_self_test()
978 if( ( ret = cmac_test_wth_cipher( verbose, in mbedtls_cmac_self_test()
989 return( ret ); in mbedtls_cmac_self_test()
993 if( ( ret = cmac_test_subkeys( verbose, in mbedtls_cmac_self_test()
1002 return( ret ); in mbedtls_cmac_self_test()
1005 if( ( ret = cmac_test_wth_cipher( verbose, in mbedtls_cmac_self_test()
1016 return( ret ); in mbedtls_cmac_self_test()
1021 if( ( ret = test_aes128_cmac_prf( verbose ) ) != 0 ) in mbedtls_cmac_self_test()
1022 return( ret ); in mbedtls_cmac_self_test()