Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apps/speed: merge curve list definitions #6132

Closed

Conversation

FdaSilvaYY
Copy link
Contributor

@FdaSilvaYY FdaSilvaYY commented Apr 29, 2018

It's a small code improvement: just merge the three list of values declaring each elliptic curve.

Edit : Second commit is because other bits are defined as unsigned except test_curves->bits.

@dot-asm
Copy link
Contributor

dot-asm commented Apr 29, 2018

Red cross from appveyor is from TLSProxy tests and caused by server resetting connection before alert went through "wire". This is unrelated.

apps/speed.c Outdated
const char *name;
unsigned int nid;
unsigned int bits;
} curve_nameid_t;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't actually have to typedef, but ok...

apps/speed.c Outdated
/*
* We only test over the following curves as they are representative, To
* add tests over more curves, simply add the curve NID and curve name to
* the following arrays and increase the EC_NUM value accordingly.
*/
static const unsigned int test_curves[EC_NUM] = {
static const curve_nameid_t test_curves[EC_NUM] =
Copy link
Contributor

@dot-asm dot-asm Apr 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish it was possible to omit EC_NUM. But at least, while you are at it, would you declare this array as [], and insert OPENSSL_assert that compares number of elements to EC_NUM? So that it works as remainder reminder when you add things to it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, will looking at this more carefully, I found a larger issue.
There is :

  • 18 ecdh curves as EC_NUM states
  • and only ecdsa 16 curves but it reuse EC_NUM value

Fix in progress => see #6133

@FdaSilvaYY FdaSilvaYY force-pushed the apps/speed/merge_curve_lists branch 2 times, most recently from 0f4de48 to 5e820b7 Compare April 30, 2018 10:09
@FdaSilvaYY
Copy link
Contributor Author

Fixed and rebase; CI's are fully Green 🍾

apps/speed.c Outdated
unsigned int nid;
unsigned int bits;
} test_curves[] =
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I was under impression that preferred style would be to have opening { at same line. See for example ecp_nistp256.c...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's minor formatting nit, so I'm approving this provided that fix-up would be a separate commit that would be squashed upon commit to repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed !

@dot-asm dot-asm added the approval: review pending This pull request needs review by a committer label May 1, 2018
@FdaSilvaYY FdaSilvaYY force-pushed the apps/speed/merge_curve_lists branch from 5e820b7 to e28f506 Compare May 1, 2018 14:19
@dot-asm
Copy link
Contributor

dot-asm commented May 1, 2018

Hmmm... As procedural comment. "Provided that fix-up would be a separate commit" was actually condition that it was commit on top [of] prior commits, more specifically with their original ids. But now all commits ids are new. Point is that formally speaking I now don't know if it's based on original submission or not, and therefore have to review it as if it's all new submission. It's no biggie in this case, it's pretty simple, but imagine if it was something complex. And since it's all new ids, it could as well be pre-squashed...

@levitte levitte added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels May 2, 2018
@dot-asm
Copy link
Contributor

dot-asm commented May 2, 2018

Editorial note. I'm going to squash everything into one commit.

@FdaSilvaYY
Copy link
Contributor Author

@dot-asm : sorry for the rebase, it was a reflex ;)
Feel free to merge these commits.

@dot-asm
Copy link
Contributor

dot-asm commented May 2, 2018

Merged. Thanks!

@dot-asm dot-asm closed this May 2, 2018
levitte pushed a commit that referenced this pull request May 2, 2018
... and unify 'bits' declarations and printing format.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #6132)
@FdaSilvaYY FdaSilvaYY deleted the apps/speed/merge_curve_lists branch May 2, 2018 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants