Add benchmarks and memory tracking feature to Signature Examples#467
Add benchmarks and memory tracking feature to Signature Examples#467miyazakh wants to merge 8 commits intowolfSSL:masterfrom
Conversation
661dd3a to
b6328e5
Compare
|
Hi @cconlon |
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.
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.
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.
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.
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.
Spelling - "archtecture" should be "architecture"
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.
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.
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.
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.
| */ | ||
|
|
||
| #include <stdio.h> | ||
| #include<wolfssl/wolfcrypt/settings.h> |
There was a problem hiding this comment.
Need a space after "#include" for settings.h
| #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.
Please add a space after #include for ssl.h and test.h.
| if ((int)decSigLen < 0) | ||
| ret = (int)decSigLen; | ||
| } | ||
|
|
| */ | ||
|
|
||
| #include <stdio.h> | ||
| #include<wolfssl/wolfcrypt/settings.h> |
There was a problem hiding this comment.
Add space after #include for settings.h, ssl.h, test.h
| 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.
Check this line against our 80 character limit.
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