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: various cleanups and improvements #10078

Closed

Conversation

FdaSilvaYY
Copy link
Contributor

@FdaSilvaYY FdaSilvaYY commented Oct 2, 2019

  • replace bunchs of #define with enums.
  • load crypto material only when its algorithm is enabled.
  • improve error handling, avoid exit(1) when default provider is missing.
  • factorize some internal structures definitions for tested curves.
Checklist
  • documentation is added or updated
  • tests are added or updated

@FdaSilvaYY
Copy link
Contributor Author

FdaSilvaYY commented Oct 2, 2019

Old staging branch on my sandbox.
Ping @paulidale : you may be interested in this
I'm not happy with a few changes in it.

apps/speed.c Outdated
D_EVP, D_SHA256, D_SHA512, D_WHIRLPOOL,
D_IGE_128_AES, D_IGE_192_AES, D_IGE_256_AES,
D_GHASH, D_RAND, D_EVP_HMAC, D_EVP_CMAC
};
/* name of algorithms to test */
static const char *names[] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the use of enums above, I'm more concerned about the disconnect between then and the string representations of the algs. This one was already there but some of the later ones remove the name, id pairings in favour of just having the name which means both lists need to be manually kept synchronised.

apps/speed.c Outdated Show resolved Hide resolved
apps/speed.c Outdated Show resolved Hide resolved
@FdaSilvaYY FdaSilvaYY force-pushed the apps/speed/various_cleanup branch 9 times, most recently from 9d0553c to 25d0665 Compare October 19, 2019 18:51
@FdaSilvaYY FdaSilvaYY marked this pull request as ready for review October 19, 2019 19:01
@FdaSilvaYY FdaSilvaYY changed the title apps/speed: various cleanups apps/speed: various cleanups and improvements Oct 19, 2019
@FdaSilvaYY
Copy link
Contributor Author

Ping @openssl : it is ready for review. 200 lines of code less.
I see many more places for improvement, I keep its for a next PR.

apps/speed.c Show resolved Hide resolved
@t8m t8m added approval: otc review pending This pull request needs review by an OTC member branch: master Merge to master branch labels Dec 3, 2019
@t8m t8m self-assigned this Dec 3, 2019
Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Good work.

apps/speed.c Show resolved Hide resolved
@FdaSilvaYY FdaSilvaYY force-pushed the apps/speed/various_cleanup branch 2 times, most recently from 53682cd to 63d8fb1 Compare December 3, 2019 21:57
{ test3072, sizeof(test3072), 3072 },
{ test4096, sizeof(test4096), 4092 },
{ test7680, sizeof(test7680), 7680 },
{ test15360, sizeof(test15360), 15360 }
Copy link
Member

Choose a reason for hiding this comment

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

Thanks! 😃

@levitte
Copy link
Member

levitte commented Dec 3, 2019

Travis failure relevant:

apps/speed.c:248:12: error: 'alg_found' defined but not used [-Werror=unused-function]
 static int alg_found(const char *name, unsigned int *result,
            ^
cc1: all warnings being treated as errors

@levitte
Copy link
Member

levitte commented Dec 3, 2019

Other than that, I like what I see now

…simplifies some pieces of code. Improve internal assertions Tag a few #endif with OPENSSL_NO_EC to mark its ending.
@levitte
Copy link
Member

levitte commented Dec 5, 2019

@t8m, if your approval still holds, will you change the labels?

@t8m t8m added approval: done This pull request has the required number of approvals approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: otc review pending This pull request needs review by an OTC member approval: done This pull request has the required number of approvals labels Dec 6, 2019
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
previouly the exit(1) call was aborting the whole execution.
Improve error message.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
…fore being used.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
replace |save_count| by the right c[D_EVP(_xxx)] variable.
this may shared a value between various algorithm.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
Remove some duplicate key data declarations.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
Optimize algorithm selection code.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
attach the new objects sooner, so error handling is simplified.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
remove 'test' prefix from variable names.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
openssl-machine pushed a commit that referenced this pull request Dec 9, 2019
it simplifies some pieces of code.
Improve internal assertions
Tag a few #endif with OPENSSL_NO_EC to mark its ending.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #10078)
@t8m
Copy link
Member

t8m commented Dec 9, 2019

Merged to master as: af0857f 2cc0765 d02b7e0 0609658 f607f6e 001d5e2 d63d89e 1352e0f

@t8m t8m closed this Dec 9, 2019
@FdaSilvaYY FdaSilvaYY deleted the apps/speed/various_cleanup branch December 10, 2019 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants