OpenSSL ECDSA verification performance issue

454 views Asked by At

I'm working on a project where I use ECDSA cryptography. For signature and key generation I use a hardware module, and I do the verification stuff using openssl.

My problem is that a single verification take 12 milliseconds. This is an ARM device (i.MX6 Quad, 4x1Ghz, 2Gb ram), but still, it looks very slow.

I compile using "arm-poky-linux-gnueabi-g++", provided by the hardware provider. Using -O3 vs -O0 does not radically change the time needed to verify.

std::vector<unsigned char> digest = sha256(content);
ECDSA_SIG* sig = ...
EC_KEY* ec_key = ...

auto tref = getTimeInMillis();
int result = ECDSA_do_verify(&(digest[0]),digest.size(), sig , ec_key);
auto duration = getTimeInMillis() - tref;
LOG("call to ECDSA_do_verify " + std::to_string(duration)+ "ms");

This line ECDSA_do_verify take 12ms (the test is done in a batch, this is stable). Do you think this is a reasonable time ?

0

There are 0 answers