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

/dev/crypto auth error fix/adjustment for benchmark #8210

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

night1rider
Copy link
Contributor

When configuring wolfSSL to use /dev/crypto and running our benchmark tool, GMAC benchmarks will throw the -265 error code after calling this line.

This is because is due to this line in /dev/crypto driver.

This PR adds better debugging and will set size when running GMAC to that of the system's page size. It also allows for an override for this size by setting the macro WOLFSSL_AUTHSZ_BENCH

@night1rider night1rider self-assigned this Nov 21, 2024
@night1rider night1rider changed the title /dev/crypto auth error fix/adjustment /dev/crypto auth error fix/adjustment for benchmark Nov 21, 2024
@night1rider night1rider force-pushed the devcrypto-authtag-error branch from 64129b7 to eebd121 Compare November 22, 2024 02:43
@dgarske
Copy link
Contributor

dgarske commented Nov 22, 2024

Retest this please - Python test

Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

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

Looks like sysconf is in QNX too (another system which has /dev/crypto) which is good, so seems portable enough for a call wrapped with the debug macro guard. Assign to wolfssl-bot when ready for a final review and potential merge into master branch.

@night1rider
Copy link
Contributor Author

night1rider commented Nov 25, 2024

Some Extra Information:

sysconf is a apart of unistd.h which our port for /dev/crypto uses here. This document also states that _SC_PAGE_SIZE is apart of the table that defines the minimal set of system variables.

Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

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

Works as expected. Please resolve this warning though:

  CC       examples/server/examples_server_server-server.o
wolfcrypt/benchmark/benchmark.c: In function ‘bench_gmac’:
wolfcrypt/benchmark/benchmark.c:4846:71: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=]
         printf("authIn Buffer Size[%d] greater than System Page Size[%d]\n",
                                                                      ~^
                                                                      %ld
                         bench_size, sysconf(_SC_PAGESIZE));
                                     ~~~~~~~~~~~~~~~~~~~~~              
  CC       examples/pem/pem.o

@night1rider night1rider force-pushed the devcrypto-authtag-error branch from 7dc7887 to 02e6ec0 Compare November 25, 2024 21:43
@night1rider
Copy link
Contributor Author

Fixed to resolve warning with benchmark, and squashed.

@night1rider
Copy link
Contributor Author

Retest this please

@JacobBarthelmeh JacobBarthelmeh merged commit 0243299 into wolfSSL:master Nov 25, 2024
143 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants