Lines Matching refs:ret

101     int ret, i, j;
106 ret = mbedtls_block_cipher_encrypt(&ctx->block_cipher_ctx, h, h);
109 ret = mbedtls_cipher_update(&ctx->cipher_ctx, h, 16, h, &olen);
111 if (ret != 0) {
112 return ret;
167 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
176 if ((ret = mbedtls_block_cipher_setup(&ctx->block_cipher_ctx, cipher)) != 0) {
177 return ret;
180 if ((ret = mbedtls_block_cipher_setkey(&ctx->block_cipher_ctx, key, keybits)) != 0) {
181 return ret;
198 if ((ret = mbedtls_cipher_setup(&ctx->cipher_ctx, cipher_info)) != 0) {
199 return ret;
202 if ((ret = mbedtls_cipher_setkey(&ctx->cipher_ctx, key, keybits,
204 return ret;
208 if ((ret = gcm_gen_table(ctx)) != 0) {
209 return ret;
381 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
439 ret = mbedtls_block_cipher_encrypt(&ctx->block_cipher_ctx, ctx->y, ctx->base_ectr);
441 ret = mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ctx->base_ectr, &olen);
443 if (ret != 0) {
444 return ret;
540 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
543 ret = mbedtls_block_cipher_encrypt(&ctx->block_cipher_ctx, ctx->y, ectr);
546 ret = mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ectr, &olen);
548 if (ret != 0) {
550 return ret;
569 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
610 if ((ret = gcm_mask(ctx, ectr, offset, use_len, p, out_p)) != 0) {
611 return ret;
628 if ((ret = gcm_mask(ctx, ectr, 0, 16, p, out_p)) != 0) {
629 return ret;
641 if ((ret = gcm_mask(ctx, ectr, 0, input_length, p, out_p)) != 0) {
642 return ret;
715 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
718 if ((ret = mbedtls_gcm_starts(ctx, mode, iv, iv_len)) != 0) {
719 return ret;
722 if ((ret = mbedtls_gcm_update_ad(ctx, add, add_len)) != 0) {
723 return ret;
726 if ((ret = mbedtls_gcm_update(ctx, input, length,
728 return ret;
731 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) {
732 return ret;
749 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
753 if ((ret = mbedtls_gcm_crypt_and_tag(ctx, MBEDTLS_GCM_DECRYPT, length,
756 return ret;
1022 int i, j, ret;
1060 ret = mbedtls_gcm_setkey(&ctx, cipher,
1068 if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && key_len == 192) {
1071 } else if (ret != 0) {
1075 ret = mbedtls_gcm_crypt_and_tag(&ctx, MBEDTLS_GCM_ENCRYPT,
1085 if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED &&
1091 if (ret != 0) {
1098 ret = 1;
1115 ret = mbedtls_gcm_setkey(&ctx, cipher,
1118 if (ret != 0) {
1122 ret = mbedtls_gcm_crypt_and_tag(&ctx, MBEDTLS_GCM_DECRYPT,
1130 if (ret != 0) {
1137 ret = 1;
1154 ret = mbedtls_gcm_setkey(&ctx, cipher,
1157 if (ret != 0) {
1161 ret = mbedtls_gcm_starts(&ctx, MBEDTLS_GCM_ENCRYPT,
1164 if (ret != 0) {
1168 ret = mbedtls_gcm_update_ad(&ctx,
1171 if (ret != 0) {
1177 ret = mbedtls_gcm_update(&ctx,
1181 if (ret != 0) {
1188 ret = mbedtls_gcm_update(&ctx,
1192 if (ret != 0) {
1199 ret = mbedtls_gcm_update(&ctx,
1203 if (ret != 0) {
1211 ret = mbedtls_gcm_finish(&ctx, NULL, 0, &olen, tag_buf, 16);
1212 if (ret != 0) {
1219 ret = 1;
1236 ret = mbedtls_gcm_setkey(&ctx, cipher,
1239 if (ret != 0) {
1243 ret = mbedtls_gcm_starts(&ctx, MBEDTLS_GCM_DECRYPT,
1246 if (ret != 0) {
1249 ret = mbedtls_gcm_update_ad(&ctx,
1252 if (ret != 0) {
1258 ret = mbedtls_gcm_update(&ctx,
1261 if (ret != 0) {
1268 ret = mbedtls_gcm_update(&ctx,
1272 if (ret != 0) {
1279 ret = mbedtls_gcm_update(&ctx,
1283 if (ret != 0) {
1291 ret = mbedtls_gcm_finish(&ctx, NULL, 0, &olen, tag_buf, 16);
1292 if (ret != 0) {
1299 ret = 1;
1315 ret = 0;
1318 if (ret != 0) {
1325 return ret;