@@ -211,7 +211,7 @@ typedef struct {
211
211
*
212
212
* Cost: 8 multiplications
213
213
*/
214
- static const uint16_t code_double [] = {
214
+ static const uint16_t code_double [] PROGMEM = {
215
215
/*
216
216
* Compute z^2 (in t1).
217
217
*/
@@ -317,7 +317,7 @@ static const uint16_t code_double[] = {
317
317
*
318
318
* Cost: 16 multiplications
319
319
*/
320
- static const uint16_t code_add [] = {
320
+ static const uint16_t code_add [] PROGMEM = {
321
321
/*
322
322
* Compute u1 = x1*z2^2 (in t1) and s1 = y1*z2^3 (in t3).
323
323
*/
@@ -385,7 +385,7 @@ static const uint16_t code_add[] = {
385
385
* converted to Montgomery coordinates yet).
386
386
* -- P2x, P2y and P2z are set to, respectively, R^2, b*R and 1.
387
387
*/
388
- static const uint16_t code_check [] = {
388
+ static const uint16_t code_check [] PROGMEM = {
389
389
390
390
/* Convert x and y to Montgomery representation. */
391
391
MMUL (t1 , P1x , P2x ),
@@ -422,7 +422,7 @@ static const uint16_t code_check[] = {
422
422
* Conversion back to affine coordinates. This code snippet assumes that
423
423
* the z coordinate of P2 is set to 1 (not in Montgomery representation).
424
424
*/
425
- static const uint16_t code_affine [] = {
425
+ static const uint16_t code_affine [] PROGMEM = {
426
426
427
427
/* Save z*R in t1. */
428
428
MSET (t1 , P1z ),
@@ -482,7 +482,11 @@ run_code(jacobian *P1, const jacobian *P2,
482
482
for (u = 0 ;; u ++ ) {
483
483
unsigned op , d , a , b ;
484
484
485
+ #ifdef ESP8266
486
+ op = pgm_read_word (& code [u ]);
487
+ #else
485
488
op = code [u ];
489
+ #endif
486
490
if (op == 0 ) {
487
491
break ;
488
492
}
0 commit comments