1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

Move init_primes_array out into its own file.

Mostly because I just had a neat idea about how to expose that large
mutable array without it being a mutable global variable: make it a
static in its own module, and expose only a _pointer_ to it, which is
const-qualified.

While I'm there, changed the name to something more descriptive.
This commit is contained in:
Simon Tatham
2020-02-23 14:08:57 +00:00
parent 82df83719a
commit 9af72ca1e8
4 changed files with 73 additions and 40 deletions

12
sshkeygen.h Normal file
View File

@ -0,0 +1,12 @@
/*
* sshkeygen.h: routines used internally to key generation.
*/
/*
* A table of all the primes that fit in a 16-bit integer. Call
* init_primes_array to make sure it's been initialised.
*/
#define NSMALLPRIMES 6542 /* number of primes < 65536 */
extern const unsigned short *const smallprimes;
void init_smallprimes(void);