System Details
- Microcontroller: PIC18F27J53 (8-bit architecture, 3.8 KB RAM)
- Compiler: Microchip XC8 (v3.10)
- Clock Speed: 48 MHz
- Curve Used: secp256r1
Current Configuration
I have configured uECC.h with the following macros for my 8-bit target:
#define uECC_WORD_SIZE 1
#define uECC_OPTIMIZATION_LEVEL 3
#define uECC_SUPPORT_COMPRESSED_POINT 0
The Problem
The total processing time to complete a signature calculation takes approximately 50 seconds.
By stepping through the code, I isolated the bottleneck to the core Montgomery Ladder loop inside EccPoint_mult():
for (i = num_bits - 2; i > 0; --i) {
nb = !uECC_vli_testBit(scalar, i);
XYcZ_addC(Rx[1 - nb], Ry[1 - nb], Rx[nb], Ry[nb], sub, curve);
XYcZ_add(Rx[nb], Ry[nb], Rx[1 - nb], Ry[1 - nb], sub, curve);
}
System Details
Current Configuration
I have configured
uECC.hwith the following macros for my 8-bit target:#define uECC_WORD_SIZE 1#define uECC_OPTIMIZATION_LEVEL 3#define uECC_SUPPORT_COMPRESSED_POINT 0The Problem
The total processing time to complete a signature calculation takes approximately 50 seconds.
By stepping through the code, I isolated the bottleneck to the core Montgomery Ladder loop inside
EccPoint_mult():