Lines Matching refs:ret
99 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
108 if ((ret = mbedtls_cipher_update(ctx, L, block_size, L, &olen)) != 0) {
115 if ((ret = cmac_multiply_by_u(K1, L, block_size)) != 0) {
119 if ((ret = cmac_multiply_by_u(K2, K1, block_size)) != 0) {
126 return ret;
203 int ret = 0;
229 if ((ret = mbedtls_cipher_update(ctx, state, block_size, state,
247 if ((ret = mbedtls_cipher_update(ctx, state, block_size, state,
265 return ret;
276 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
306 if ((ret = mbedtls_cipher_update(ctx, state, block_size, state,
324 return ret;
353 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
361 if ((ret = mbedtls_cipher_setup(&ctx, cipher_info)) != 0) {
365 ret = mbedtls_cipher_cmac_starts(&ctx, key, keylen);
366 if (ret != 0) {
370 ret = mbedtls_cipher_cmac_update(&ctx, input, ilen);
371 if (ret != 0) {
375 ret = mbedtls_cipher_cmac_finish(&ctx, output);
380 return ret;
391 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
403 ret = MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE;
413 ret = mbedtls_cipher_cmac(cipher_info, zero_key, 128, key,
415 if (ret != 0) {
420 ret = mbedtls_cipher_cmac(cipher_info, int_key, 128, input, in_len,
426 return ret;
738 int i, ret = 0;
757 if ((ret = mbedtls_cipher_setup(&ctx, cipher_info)) != 0) {
765 if ((ret = mbedtls_cipher_setkey(&ctx, key, keybits,
771 if ((ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED ||
772 ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE) &&
787 ret = cmac_generate_subkeys(&ctx, K1, K2);
788 if (ret != 0) {
796 if ((ret = memcmp(K1, subkeys, block_size)) != 0 ||
797 (ret = memcmp(K2, &subkeys[block_size], block_size)) != 0) {
813 ret = 0;
820 return ret;
835 int i, ret = 0;
841 ret = MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE;
850 if ((ret = mbedtls_cipher_cmac(cipher_info, key, keybits, messages,
856 if ((ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED ||
857 ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE) &&
872 if ((ret = memcmp(output, &expected_result[i * block_size], block_size)) != 0) {
883 ret = 0;
886 return ret;
893 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
898 ret = mbedtls_aes_cmac_prf_128(PRFK, PRFKlen[i], PRFM, 20, output);
899 if (ret != 0 ||
906 return ret;
911 return ret;
917 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
921 if ((ret = cmac_test_subkeys(verbose,
929 return ret;
932 if ((ret = cmac_test_wth_cipher(verbose,
942 return ret;
947 if ((ret = cmac_test_subkeys(verbose,
955 return ret;
958 if ((ret = cmac_test_wth_cipher(verbose,
968 return ret;
974 if ((ret = cmac_test_subkeys(verbose,
982 return ret;
985 if ((ret = cmac_test_wth_cipher(verbose,
995 return ret;
1002 if ((ret = cmac_test_subkeys(verbose,
1010 return ret;
1013 if ((ret = cmac_test_wth_cipher(verbose,
1023 return ret;
1027 if ((ret = cmac_test_subkeys(verbose,
1035 return ret;
1038 if ((ret = cmac_test_wth_cipher(verbose,
1048 return ret;
1053 if ((ret = test_aes128_cmac_prf(verbose)) != 0) {
1054 return ret;