From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id A5A91F72 for ; Mon, 23 Jul 2018 18:50:31 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id k19-v6so206953pfi.1 for ; Mon, 23 Jul 2018 09:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JljK6/zGZNfnANlVedkIWToOUcs2x2iu+nzWe5AxeIA=; b=wgpy7QUaZ+x/KoeKhVrL18NcC02Cfo38Qj8HTszOTJcyDTEsAhwXlRU/TF2smQctDE ddA251H/F+aFSGjglg9nHgzwrOR85ouX2YU5MnktAr8LDmRM1hH8gk1T4SY36tDoXWij lA7Q4XpKCw0ncGr8WIcE6mprjSsuyA8J+oF3IYCUz1axGQgEbn4wXq9KXNaM24jMizJz EsvjgWWlF4U9XoPVq7qjBK1WOk1KTXk+tNxsBhqWSoIe5/QjNHW1S2Zp2jrBNfebfaV8 kiCwyuHDVGloHlC6fBCamTNQk6ZVsy7CCSa3PPzR8Hdgyypws6yPE/4QfGrZQHl/OOpX 3F1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JljK6/zGZNfnANlVedkIWToOUcs2x2iu+nzWe5AxeIA=; b=pxMFcsMS6oOIHHo7FzeWkxgjJqwYSY2gslYtj6XTHKRssodKPxH75STfxbx7hNPY73 AswNDSJOT9o50msAFQQ4nfnV0DV0PXoryffeI0ry9mCVE8Cl33TWhBlzaiwFiP3YUVl3 YJRQUsAH4HK+3vArpne9VcWeGw5e2JOC3lo8WUHL6OyqgxnWgCCiajqbWAPIB2aIVoJ8 nShvIOduI+jpOUjUHVSmLhPlR1Wt4uB14Gynoj+2yeENNWV8g+q+A4D2LXwelGae/Khh Y+F0hy5v3a2rhTCXyirG0Bc4+D8roeuv/FVWBFusY6s27Y/V/w2puw8vdSNaR2i0XYg3 +jNQ== X-Gm-Message-State: AOUpUlGi0SokUGuDDq9g9vPoHy9xbUVxB+IRsRNoC6TQkJpOfOgKC715 BFdjSQbECS7QFXsAnLQE/XAFuw== X-Google-Smtp-Source: AAOMgpclFR2hYmD9iZedaJcsDRaHF+OpCN7n391H6dCiaE9XZYgS27f7u3r2OPdy5WdVEU6B9AWI7Q== X-Received: by 2002:a63:b256:: with SMTP id t22-v6mr13277546pgo.101.1532364630403; Mon, 23 Jul 2018 09:50:30 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id c7-v6sm14121044pfh.25.2018.07.23.09.50.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 09:50:30 -0700 (PDT) Date: Mon, 23 Jul 2018 09:50:27 -0700 From: Stephen Hemminger To: Shally Verma Cc: pablo.de.lara.guarch@intel.com, dev@dpdk.org, pathreya@caviumnetworks.com, nmurthy@caviumnetworks.com, Sunila Sahu , Ashish Gupta Message-ID: <20180723095027.40c7c1bf@xeon-e3> In-Reply-To: <1532357165-8575-2-git-send-email-shally.verma@caviumnetworks.com> References: <1532357165-8575-1-git-send-email-shally.verma@caviumnetworks.com> <1532357165-8575-2-git-send-email-shally.verma@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 16:50:32 -0000 On Mon, 23 Jul 2018 20:16:03 +0530 Shally Verma wrote: > +#define set_rsa_params(rsa, p, q, ret) \ > + do {rsa->p = p; rsa->q = q; ret = 0; } while (0) > + > +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \ > + do { \ > + rsa->dmp1 = dmp1; \ > + rsa->dmq1 = dmq1; \ > + rsa->iqmp = iqmp; \ > + ret = 0; \ > + } while (0) > + > +#define set_rsa_keys(rsa, n, e, d, ret) \ > + do { \ > + rsa->n = n; rsa->e = e; rsa->d = d; ret = 0; \ > + } while (0) > + > +#else > + > +#define set_rsa_params(rsa, p, q, ret) \ > + (ret = !RSA_set0_factors(rsa, p, q)) > + > +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \ > + (ret = !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) > + > +/* n, e must be non-null, d can be NULL */ > +#define set_rsa_keys(rsa, n, e, d, ret) \ > + (ret = !RSA_set0_key(rsa, n, e, d)) > + > +#endif /* version < 10100000 */ > + > +#endif /* __RTA_COMPAT_H__ */ Please use inline functions instead of macros. The crypto code seems to favor macros? Macro's have no type checking and are not faster anyway.