SP updates for SM2#6808
Conversation
JacobBarthelmeh
left a comment
There was a problem hiding this comment.
Couple minor things. Very nice though!
Comparing ./configure --enable-all --enable-sp --enable-sp-asm --enable-sm2 --enable-sm3 && make
This PR with updated wolfsm :
------------------------------------------------------------------------------
wolfSSL version 5.6.3
------------------------------------------------------------------------------
Math: Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c
Single Precision: ecc 256 384 521 rsa/dh 2048 3072 4096 asm sp_x86_64.c
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
ECC [ SM2P256V1] 256 key gen 80900 ops took 1.001 sec, avg 0.012 ms, 80855.681 ops/sec
ECDHE [ SM2P256V1] 256 agree 57000 ops took 1.001 sec, avg 0.018 ms, 56933.216 ops/sec
ECDSA [ SM2P256V1] 256 sign 56200 ops took 1.001 sec, avg 0.018 ms, 56125.185 ops/sec
ECDSA [ SM2P256V1] 256 verify 49800 ops took 1.001 sec, avg 0.020 ms, 49735.541 ops/sec
Benchmark complete
Vs current master:
------------------------------------------------------------------------------
wolfSSL version 5.6.3
------------------------------------------------------------------------------
Math: Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c
Single Precision: ecc 256 384 521 rsa/dh 2048 3072 4096 asm sp_x86_64.c
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
ECC [ SM2P256V1] 256 key gen 20300 ops took 1.004 sec, avg 0.049 ms, 20228.069 ops/sec
ECDHE [ SM2P256V1] 256 agree 20800 ops took 1.002 sec, avg 0.048 ms, 20753.558 ops/sec
ECDSA [ SM2P256V1] 256 sign 16600 ops took 1.002 sec, avg 0.060 ms, 16573.829 ops/sec
ECDSA [ SM2P256V1] 256 verify 15800 ops took 1.002 sec, avg 0.063 ms, 15770.492 ops/sec
Benchmark complete
|
In re-reviewing ./wolfcrypt/test/testwolfcrypt is failing for me: Env. details: Trying with clang gives the same unit test failure error. Also could see the error reported when removing the --enable-sp-asm flag. EDIT: Another data point is that attempting this same build on master branches of wolfsm and wolfssl passes the unit tests. |
|
The problem came from sm2.c where I was using the SP implementation even though it was a custom curve. |
|
That solved the ./wolfcrypt/test/testwolfcrypt report for me. Am seeing a unit test failure though when running 'make check' still though (same configure). |
Allow wolfSSL to build with SP implementations of SM2. Updates to SP implementation of other code.
|
Fixed |
Description
Allow wolfSSL to build with SP implementations of SM2.
Updates to SP implementation of other code.
Testing
How did you test?
Checklist