Lines Matching defs:ec
51 int dcrypt_gnutls_error(int ec, const char **error_r)
53 i_assert(ec < 0);
55 *error_r = gnutls_strerror(ec);
149 int ec;
150 ec = gnutls_cipher_init(&ctx->ctx, ctx->cipher, &ctx->key, &ctx->iv);
151 if(ec < 0) return dcrypt_gnutls_error(ec, error_r);
158 int ec;
161 ec = gnutls_cipher_encrypt2(ctx->ctx, data, data_len, buf, outl);
162 if(ec < 0) return dcrypt_gnutls_error(ec, error_r);
164 return ec;
218 int ec;
219 ec = gnutls_hmac_init(&ctx->ctx, ctx->md, ctx->key.data, ctx->key.size);
220 if (ec < 0) return dcrypt_gnutls_error(ec, error_r);
226 int ec;
227 if ((ec = gnutls_hmac(ctx->ctx, data, data_len)) != 0)
228 return dcrypt_gnutls_error(ec, error_r);
296 int ec;
298 if ((ec = gnutls_privkey_init(&priv)) != GNUTLS_E_SUCCESS) return dcrypt_gnutls_error(ec, error_r);
302 ec = gnutls_privkey_generate(priv, pk_algo, bits, 0);
303 if (ec != GNUTLS_E_SUCCESS) {
305 return dcrypt_gnutls_error(ec, error_r);
355 int ec;
361 ec = gnutls_privkey_export_rsa_raw(priv, &m, &e, NULL, NULL, NULL, NULL, NULL, NULL);
362 if (ec != GNUTLS_E_SUCCESS) return dcrypt_gnutls_error(ec, error_r);
365 ec = gnutls_pubkey_import_rsa_raw(pub, &m, &e);
368 if (ec < 0) {
370 return dcrypt_gnutls_error(ec, error_r);
377 ec = gnutls_privkey_export_ecc_raw(priv, &curve, &x, &y, NULL);
378 if (ec != GNUTLS_E_SUCCESS) return dcrypt_gnutls_error(ec, error_r);
381 ec = gnutls_pubkey_import_ecc_raw(pub, curve, &x, &y);
384 if (ec < 0) {
386 return dcrypt_gnutls_error(ec, error_r);