Polly 20.0.0git
Typedefs | Functions
randprime.c File Reference
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <unistd.h>
#include "imath.h"
#include "iprime.h"

Go to the source code of this file.

Typedefs

typedef mp_result(* find_f) (mp_int, FILE *)
 

Functions

int randomize (unsigned char *buf, size_t len)
 
mp_result mp_int_randomize (mp_int a, mp_size n_bits)
 
mp_result find_prime (mp_int seed, FILE *fb)
 
mp_result find_strong_prime (mp_int seed, FILE *fb)
 
int main (int argc, char *argv[])
 

Typedef Documentation

◆ find_f

typedef mp_result(* find_f) (mp_int, FILE *)

Definition at line 59 of file randprime.c.

Function Documentation

◆ find_prime()

mp_result find_prime ( mp_int  seed,
FILE *  fb 
)

Definition at line 184 of file randprime.c.

References count(), MP_FALSE, mp_int_add_value, mp_int_is_even(), mp_int_is_prime(), MP_OK, MP_TRUE, and res.

Referenced by find_strong_prime(), and main().

◆ find_strong_prime()

mp_result find_strong_prime ( mp_int  seed,
FILE *  fb 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ mp_int_randomize()

mp_result mp_int_randomize ( mp_int  a,
mp_size  n_bits 
)

Definition at line 151 of file randprime.c.

References a(), mp_int_read_unsigned, MP_MEMORY, MP_OK, MP_TRUNC, randomize(), and res.

Referenced by main().

◆ randomize()

int randomize ( unsigned char *  buf,
size_t  len 
)

Definition at line 139 of file randprime.c.

Referenced by mp_int_randomize().