From: Stephen Hemminger <stephen@networkplumber.org>
To: Shally Verma <shally.verma@caviumnetworks.com>
Cc: pablo.de.lara.guarch@intel.com, dev@dpdk.org,
pathreya@caviumnetworks.com, nmurthy@caviumnetworks.com,
Sunila Sahu <sunila.sahu@caviumnetworks.com>,
Ashish Gupta <ashish.gupta@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op
Date: Mon, 23 Jul 2018 09:50:27 -0700 [thread overview]
Message-ID: <20180723095027.40c7c1bf@xeon-e3> (raw)
In-Reply-To: <1532357165-8575-2-git-send-email-shally.verma@caviumnetworks.com>
On Mon, 23 Jul 2018 20:16:03 +0530
Shally Verma <shally.verma@caviumnetworks.com> 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.
next prev parent reply other threads:[~2018-07-23 16:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 14:46 [dpdk-dev] [PATCH v5 0/3]crypto/openssl: support asymmetric crypto Shally Verma
2018-07-23 14:46 ` [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op Shally Verma
2018-07-23 16:50 ` Stephen Hemminger [this message]
2018-07-23 16:55 ` Verma, Shally
2018-11-14 15:04 ` Mcnamara, John
2018-11-15 8:33 ` Verma, Shally
2018-07-23 14:46 ` [dpdk-dev] [PATCH v5 2/3] crypto/openssl: add dh and dsa " Shally Verma
2018-07-23 14:46 ` [dpdk-dev] [PATCH v5 3/3] doc: add asym feature list Shally Verma
2018-07-24 16:19 ` [dpdk-dev] [PATCH v5 0/3]crypto/openssl: support asymmetric crypto De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180723095027.40c7c1bf@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=ashish.gupta@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=nmurthy@caviumnetworks.com \
--cc=pablo.de.lara.guarch@intel.com \
--cc=pathreya@caviumnetworks.com \
--cc=shally.verma@caviumnetworks.com \
--cc=sunila.sahu@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).