← Commit list

81f9a0035

Denys Vlasenko
Denys Vlasenko
2021-04-27
SUCCESS Duration: 155s

Subject

tls: tweak sp_256_ecc_gen_k_10 for smaller code

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/tls_sp_c32.c+0 -7
@@ -859,13 +859,11 @@ static void sp_ecc_secret_gen_256(const sp_digit priv[10], const uint8_t *pub2x3
/* Generates a scalar that is in the range 1..order-1. */
#define SIMPLIFY 1
/* Add 1 to a. (a = a + 1) */
-#if !SIMPLIFY
static void sp_256_add_one_10(sp_digit* a)
{
a[0]++;
sp_256_norm_10(a);
}
-#endif
static void sp_256_ecc_gen_k_10(sp_digit k[10])
{
#if !SIMPLIFY
@@ -896,12 +894,7 @@ static void sp_256_ecc_gen_k_10(sp_digit k[10])
break;
#endif
}
-#if !SIMPLIFY
sp_256_add_one_10(k);
-#else
- if (k[0] == 0)
- k[0] = 1;
-#endif
#undef SIMPLIFY
}