DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Verma, Shally" <Shally.Verma@cavium.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "pablo.de.lara.guarch@intel.com" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Athreya, Narayana Prasad" <NarayanaPrasad.Athreya@cavium.com>,
	"Murthy, Nidadavolu" <Nidadavolu.Murthy@cavium.com>,
	"Sahu, Sunila" <Sunila.Sahu@cavium.com>,
	"Gupta, Ashish" <Ashish.Gupta@cavium.com>
Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op
Date: Mon, 23 Jul 2018 16:55:16 +0000	[thread overview]
Message-ID: <CY4PR0701MB36349043B7B60323BF3B1B01F0560@CY4PR0701MB3634.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20180723095027.40c7c1bf@xeon-e3>



>-----Original Message-----
>From: Stephen Hemminger <stephen@networkplumber.org>
>Sent: 23 July 2018 22:20
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: pablo.de.lara.guarch@intel.com; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>; Murthy,
>Nidadavolu <Nidadavolu.Murthy@cavium.com>; Sahu, Sunila <Sunila.Sahu@cavium.com>; Gupta, Ashish
><Ashish.Gupta@cavium.com>
>Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op
>
>External Email
>
>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?
>
Since amount of code is very miniscule under each, so keeping as macro looked reasonable however, what goes in favour of inline than macros?

Thanks for feedback.
Shally

>Macro's have no type checking and are not faster anyway.

  reply	other threads:[~2018-07-23 16:55 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
2018-07-23 16:55     ` Verma, Shally [this message]
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=CY4PR0701MB36349043B7B60323BF3B1B01F0560@CY4PR0701MB3634.namprd07.prod.outlook.com \
    --to=shally.verma@cavium.com \
    --cc=Ashish.Gupta@cavium.com \
    --cc=NarayanaPrasad.Athreya@cavium.com \
    --cc=Nidadavolu.Murthy@cavium.com \
    --cc=Sunila.Sahu@cavium.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stephen@networkplumber.org \
    /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).