From 2d164e5bcd9687d9da6c77f9e6b38af8a2014daf Mon Sep 17 00:00:00 2001 From: Ken MacKay Date: Wed, 5 Jun 2013 22:52:53 -0700 Subject: [PATCH] Updated speed and size results. --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++-- test/results.txt | 14 +++++++++++- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 92a6954..9b72863 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Features * Written in C, with optional inline assembly for ARM and Thumb platforms. * Small code size: as low as 1800 bytes when compiled for Thumb (eg, Cortex-M0). + * No dynamic memory allocation. * Reasonably fast: on an LPC1114 at 48MHz (ARM Cortex-M0, 32-cycle 32x32 bit multiply), 192-bit ECDH shared secret calculation takes as little as ~150ms (depending on selected optimizations). * Support for 4 standard curves: secp128r1, secp192r1, secp256r1, and secp384r1 * Optional optimizations so you can choose between code size and speed. @@ -158,7 +159,57 @@ In these tests, `ECC_ASM` was defined to `ecc_asm_thumb` in all cases. ### ECDSA speed and combined code size ### -In these tests, the measured speed is the time to verify an ECDSA signature. The measured code size is the combined code size for ECDH and ECDSA. +In these tests, the measured speed is the time to verify an ECDSA signature. The measured code size is the combined code size for ECDH and ECDSA. `ECC_ASM` was defined to `ecc_asm_thumb` in all cases. -TODO +#### No other optimizations (smallest code size) #### + + + + + + + + + + + + + + + + + + + + + + + +
Curve:secp128r1secp192r1secp256r1secp384r1
ECDSA verify time (ms):108.6230.6590.21729.7
Code size (bytes):2638252628462674
+ +#### All optimizations (fastest) #### + + + + + + + + + + + + + + + + + + + + + + + +
Curve:secp128r1secp192r1secp256r1secp384r1
ECDH time (ms):108.0219.0558.51615.0
Code size (bytes):3046291832483062
diff --git a/test/results.txt b/test/results.txt index 1b914eb..0d36e17 100644 --- a/test/results.txt +++ b/test/results.txt @@ -4,6 +4,10 @@ asm on (#define ECC_ASM ecc_asm_thumb) (no lmul required) ECC_SQUARE_FUNC + ECC_USE_NAF: 75.9 (size = 2316 + 16) no opt: 85.5 (size = 1892 + 16) +including ecdsa: +all opts on: time = 108.0ms, size = 2982 + 64 +only asm: time = 108.6ms, size = 2574 + 64 + 192 bits asm off ECC_SQUARE_FUNC + ECC_USE_NAF: 337.2 (size = 2276 + 112 (lmul) + 24) @@ -26,7 +30,15 @@ asm on (#define ECC_ASM ecc_asm_thumb) (no lmul required) ECC_SQUARE_FUNC + ECC_USE_NAF: 385.8 (size = 2484 + 32) no opt: 473.6 (size = 2072 + 32) +including ecdsa: +all opts on: time = time = 558.5ms, size = 3120 + 128 +only asm: time = 590.2ms, size = 2718 + 128 + 384 bits asm on (#define ECC_ASM ecc_asm_thumb) (no lmul required) ECC_SQUARE_FUNC + ECC_USE_NAF: 1128.2 (size = 2196 + 48) -no opt: 1405.8 (size = 1784 + 48) \ No newline at end of file +no opt: 1405.8 (size = 1784 + 48) + +including ecdsa: +all opts on: time = time = 1615.0ms, size = 2870 + 192 +only asm: time = 1729.7ms, size = 2482 + 192 \ No newline at end of file