Skip to content

Commit 963e25a

Browse files
committed
keygen: added conditional compile for algorithms
1 parent 6020b4e commit 963e25a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tools/keytools/keygen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static void fwritekey(uint8_t *key, int len, FILE *f)
9999
}
100100

101101

102+
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
102103
static void keygen_rsa(WC_RNG *rng, char *pubkeyfile, int size)
103104
{
104105
RsaKey k;
@@ -146,7 +147,9 @@ static void keygen_rsa(WC_RNG *rng, char *pubkeyfile, int size)
146147
fprintf(fpub, "const uint32_t ecc256_pub_key_len = %d;\n", publen);
147148
fclose(fpub);
148149
}
150+
#endif
149151

152+
#ifdef HAVE_ECC
150153
#define ECC256_KEY_SIZE 32
151154
static void keygen_ecc256(WC_RNG *rng, char *pubkfile)
152155
{
@@ -202,8 +205,10 @@ static void keygen_ecc256(WC_RNG *rng, char *pubkfile)
202205
fprintf(fpub, "const uint32_t ecc256_pub_key_len = 64;\n");
203206
fclose(fpub);
204207
}
208+
#endif
205209

206210

211+
#ifdef HAVE_ED25519
207212
static void keygen_ed25519(WC_RNG *rng, char *pubkfile)
208213
{
209214
ed25519_key k;
@@ -241,6 +246,7 @@ static void keygen_ed25519(WC_RNG *rng, char *pubkfile)
241246
fprintf(fpub, "const uint32_t ed25519_pub_key_len = 32;\n");
242247
fclose(fpub);
243248
}
249+
#endif
244250

245251
int main(int argc, char** argv)
246252
{

0 commit comments

Comments
 (0)