Using emSecure-ECDSA

Using elliptic curves requires smaller key sizes for the same level of security. The keys use less memory when stored in an application, the algorithms run faster with smaller numbers, resulting in higher speeds. With a default key data can be signed in less than 160 ms.

All emSecure products are created to be simple but powerful, and easy to integrate. It can be used in new products and even extend existing ones as emSecure is a software solution and no additional hardware is required. The code is completely written in ANSI C and can be used platform- and controller-independent. The required key pairs can be generated with the included tool. The generated keys can be exported into different formats to be stored on the application code or loaded from a key file. This allows portability and exchangeability between different platforms. Signing data, for instance firmware images, can be done immediately with the included tool. It is also possible to integrate the signing process directly into a production application running on any PC or even on a microcontroller. Once a signature is generated, the signed data can be verified by its signature in an embedded application or on an external application communicating with the device. Verifying data typically takes less than 100 ms on a Cortex-M7, running at 216 MHz, which is not significantly more time for a bootloader to start a firmware.


emSecure-ECDSA aims for portability and is designed to fit speed and size requirements for different targets.
The process of verifying data is technically split up into two steps:

  • Compute the hash of the data.
  • Compare the hash value against the one stored in the signature

Step 1, the computation of the hash, depends on the size of the data, whereas step 2 is dependent on the key length and takes the same time to verify any data.

Hash computation
3.70 MB/sec
Signature verification
67.45 ms
Signature generation
141.43 ms

Verifying Data: The following table shows some total values to verify different amounts of data.

Data sizeKey curveSignature verificationHash computationTotal time
1 kByteP-25667.45 ms0.27 ms67.72 ms
100 kByteP-25667.45 ms27.00 ms94.45 ms

Signing Data: The following table shows some total values to sign different amounts of data.

Data sizeKey curveSignature generationHash computationTotal time
1 kByteP-256141.43 ms0.27 ms141.70 ms
100 kByteP-256141.43 ms27.00 ms168.43 ms

Test configuration:

  • SEGGER Embedded Studio 3.35 using clang 5.0.1 compiler
  • SHA-256 algorithm configured for speed optimization
  • Using twin multiply for ECDSA verification
  • Test on a STM32F746 microcontroller, running at 216 MHz

Memory Footprint

ROMStatic RAMStack P-256 key
Verification only:9.2 KByte0.04 KByte2.4 KByte
Verification & Generation:10.8 KByte0.04 KByte6.2 KByte

Test configuration:

  • SEGGER Embedded Studio 3.35 using gcc compiler
  • SHA-256 algorithm configured for size optimization
  • Not using twin multiply for ECDSA verification
  • Compiled for a Cortex-M7 microcontroller, optimized for size

Included Applications

emSecure includes all basic applications needed for securing a product. The applications’ source-code is included and provides an easy to use starting point for modifications and integration into other applications.

Application nameTarget platformDescription
emKeyGen ECDSAWindowsGenerates a key pair with a given curve.
emSign ECDSAWindowsDigitally signs a file with your private key.
emVerify ECDSAWindowsVerifies the signature of a digital asset with its public key.
emPrintKey ECDSAWindowsExports keys and signatures into C source format, to be included into any application.

The sign and verify tools are available for evaluation.

The utilities are PC applications, ready-to-use for the setup step to secure your product.

Key generation:

emKeyGen ECDSA generates a public and a private key. The generation parameters can be set with command line options. The keys are saved in a common key file format and can be published and exchanged. Usage: emKeyGenECDSA.exe [<options>]</options>

Exporting keys:

emPrintKey exports key and signature files into a compileable format. The output can be linked into your application, so there is no need to load them from a file at runtime. This is especially useful for embedded applications.

Signing data:

emSign ECDSA digitally signs the file content, usually the data to be secured, with a given (private) key file and creates a signature file.

Verifying data:

emVerify ECDSA decrypts a signature file and verifies if the corresponding data file matches the signature.

Technical Background

emSecure ECDSA

emSecure Signing Technical Details:

The emSecure-ECDSA signing operation starts by using a secure hash algorithm (SHA256) to generate a hash from the original data. Using the ECDSA private key a digital signature is created following the digital signature algorithm.


emSecure Verification Technical Details:

The emSecure-ECDSA verification process starts with the data one wishes to verify and the digital signature which was created from the original file. A hash value is generated for the unverified data. The ECDSA public key is used to extract the original hash from the signature and then compare it with the generated hash to verify whether the data file is genuine or not.