Skip to content

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

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
night1rider:devcrypto-authtag-error
Nov 25, 2024
Merged

/dev/crypto auth error fix/adjustment for benchmark#8210
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
night1rider:devcrypto-authtag-error

Conversation

@night1rider
Copy link
Copy Markdown
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
Copy Markdown
Member

dgarske commented Nov 22, 2024

Retest this please - Python test

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Fixed to resolve warning with benchmark, and squashed.

@night1rider
Copy link
Copy Markdown
Contributor Author

Retest this please

@JacobBarthelmeh JacobBarthelmeh merged commit 0243299 into wolfSSL:master Nov 25, 2024
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