-
Notifications
You must be signed in to change notification settings - Fork 185
Add benchmarks and memory tracking feature to Signature Examples #467
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
base: master
Are you sure you want to change the base?
Conversation
661dd3a
to
b6328e5
Compare
Hi @cconlon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See minor comments. @miyazakh, did you also verify all examples run as expected against current master wolfssl?
embedded/signature/README.md
Outdated
@@ -0,0 +1,92 @@ | |||
# Signature Examples for Embedded Systems | |||
| |||
This directory includes the following examples under the sub-directories.Each has a Makefile and source files to build and execute the example and a README to show how to build and Example output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we adjust this to read:
This directory includes the following examples. Each subdirectory has a Makefile, source files, and a README to show how to build the example, along with expected example output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.Thanks
embedded/signature/README.md
Outdated
||ecc_vfy_only_nonblock|verify signature with non-blocking| | ||
|
||
|
||
You can specify a target function of Simple example, Benchemark or Memory track program.It also has options for optimized code for MCU architectures such as Intel x86, ARM64 or a generic code by default, as well as Math library of Single Precision or TFM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we adjust this to read:
When building each example, you can specify arguments to control the build. Specify a target function to run either a simple example, benchmark, or memory tracking example. Specify an "arch" option to build optimized code for MCU architectures such as Intel x86, ARM64 or a generic code by default. And specify a "math" option to choose an underlying wolfCrypt math library to use, between Single Precision or TFM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
embedded/signature/README.md
Outdated
|math|Description| | ||
|---|---| | ||
|Default|Generic architecture by pure C language source code| | ||
|sp| SP for generic or specified archtecture| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling - "archtecture" should be "architecture"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
embedded/signature/README.md
Outdated
|x64|SP for x86 64bit| | ||
|
||
|
||
The Makefile is self-contained without libwolfssl. Put your wolfSSL source filesin parallel with wolfssl-examples directory. It is defined by WOLFROOT in Makefile.It compiles only needed files for the target. OBJ and OBJ_xxx macro in Makefiledefine object files for the common and specific target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph needs some spacing adjustments and rework. I suggest we change it to read:
Each Makefile is self-contained to statically link wolfCrypt source files (without using a shared libwolfssl.so). Put your wolfSSL source files in parallel with the wolfssl-examples directory. The location of the primary wolfSSL source directory is defined by WOLFROOT in each Makefile. Each build compiles only the needed files for the target. OBJ and OBJ_xxx macros in each Makefile define object files for the common and specific target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed.
embedded/signature/README.md
Outdated
|
||
The Makefile is self-contained without libwolfssl. Put your wolfSSL source filesin parallel with wolfssl-examples directory. It is defined by WOLFROOT in Makefile.It compiles only needed files for the target. OBJ and OBJ_xxx macro in Makefiledefine object files for the common and specific target. | ||
| ||
Example programs are hard coded for a hash algorithm or signature scheme.Sha256 is for the hash by default. PKCS #1 v1.5 or ECDSA for the signature scheme.You can refer to the following API tables for modifying the examples for other algorithms or schemes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spacing adjustments needed here. I suggest changing this to read:
Example programs are hard coded to use a specific hash algorithm or signature scheme. Sha256 is used for the hash by default. PKCS#1 v1.5 or ECDSA is used for the signature scheme. You can refer to the following API tables for modifying the examples for other algorithms or schemes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
*/ | ||
|
||
#include <stdio.h> | ||
#include<wolfssl/wolfcrypt/settings.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a space after "#include" for settings.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
#include<wolfssl/wolfcrypt/settings.h> | ||
#include <wolfssl/wolfcrypt/rsa.h> | ||
#include <wolfssl/wolfcrypt/sha256.h> | ||
#include<wolfssl/ssl.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space after #include for ssl.h and test.h.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
if ((int)decSigLen < 0) | ||
ret = (int)decSigLen; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra blank lines here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the line
*/ | ||
|
||
#include <stdio.h> | ||
#include<wolfssl/wolfcrypt/settings.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space after #include for settings.h, ssl.h, test.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
printf("Verified\n"); | ||
|
||
printf("Non-blocking:\n"); | ||
printf(" Total time : %.2f micro sec, Bloking count: %d \n",1000*1000*total_blk_time, blk_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this line against our 80 character limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Add becnmark and memory tranking to the following program: signature/rsa_vfy_only/verify signature/rsa_buffer/verify signature/ecc-sign-verify/ecc_sign_verify
-modified Makefile to execute clean target before building. -modified Makefile to add CFLAGS for sp_x86_64. -fixed BENCH_TIME_SEC possible to be defined by compiler flags. -add -lpthread to be given to compiler.
* Add non-blocking mode for ECC Signature Example * Add non-blocking mode for RSA with TFM * Add ecc_vfy_only and ecc_vfy_only_nonblock - Add ecc_vfy_only to separate the function Verifying only from the ecc_sign_verify that signing and verifying the signatures. - Rename rsa_buffer to rsa_sign_verify - Add rsa_vfy_only_nonblock * Revise the README --------- Co-authored-by: Shingo Morimoto <shingo@wolfssl.com>
add Makefile to make all remove unnecessary files remove trailing spaces
add file header fix wc_RsaSSL_Verify
b6328e5
to
51b3eff
Compare
Hi @cconlon
Yes, I did. I ran all examples again under the latest master wolfssl. It needed tweaking |
Based on Japan Intern Morimoto san's work
Fix compile and some clean up
Original PR#352