Macros | Functions | Variables
prime.c File Reference
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include "internal.h"
#include "../../internal.h"
Include dependency graph for prime.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BN_PRIME_CHECKS_BLINDED   16
 

Functions

int BN_enhanced_miller_rabin_primality_test (enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, BN_CTX *ctx, BN_GENCB *cb)
 
int BN_GENCB_call (BN_GENCB *callback, int event, int n)
 
void BN_GENCB_set (BN_GENCB *callback, int(*f)(int event, int n, struct bn_gencb_st *), void *arg)
 
int BN_generate_prime_ex (BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb)
 
int BN_is_prime_ex (const BIGNUM *candidate, int checks, BN_CTX *ctx, BN_GENCB *cb)
 
int BN_is_prime_fasttest_ex (const BIGNUM *a, int checks, BN_CTX *ctx, int do_trial_division, BN_GENCB *cb)
 
int bn_miller_rabin_init (BN_MILLER_RABIN *miller_rabin, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
int bn_miller_rabin_iteration (const BN_MILLER_RABIN *miller_rabin, int *out_is_possibly_prime, const BIGNUM *b, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
int bn_odd_number_is_obviously_composite (const BIGNUM *bn)
 
int BN_primality_test (int *out_is_probably_prime, const BIGNUM *w, int checks, BN_CTX *ctx, int do_trial_division, BN_GENCB *cb)
 
static int BN_prime_checks_for_size (int bits)
 
static int bn_trial_division (uint16_t *out, const BIGNUM *bn)
 
static size_t num_trial_division_primes (const BIGNUM *n)
 
static int probable_prime (BIGNUM *rnd, int bits)
 
static int probable_prime_dh (BIGNUM *rnd, int bits, const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
 
static int probable_prime_dh_safe (BIGNUM *rnd, int bits, const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
 

Variables

static const uint16_t kPrimes []
 

Macro Definition Documentation

◆ BN_PRIME_CHECKS_BLINDED

#define BN_PRIME_CHECKS_BLINDED   16

Definition at line 354 of file prime.c.

Function Documentation

◆ BN_enhanced_miller_rabin_primality_test()

int BN_enhanced_miller_rabin_primality_test ( enum bn_primality_result_t out_result,
const BIGNUM w,
int  checks,
BN_CTX ctx,
BN_GENCB cb 
)

Definition at line 789 of file prime.c.

◆ BN_GENCB_call()

int BN_GENCB_call ( BN_GENCB callback,
int  event,
int  n 
)

Definition at line 369 of file prime.c.

◆ BN_GENCB_set()

void BN_GENCB_set ( BN_GENCB callback,
int(*)(int event, int n, struct bn_gencb_st *)  f,
void *  arg 
)

Definition at line 362 of file prime.c.

◆ BN_generate_prime_ex()

int BN_generate_prime_ex ( BIGNUM ret,
int  bits,
int  safe,
const BIGNUM add,
const BIGNUM rem,
BN_GENCB cb 
)

Definition at line 377 of file prime.c.

◆ BN_is_prime_ex()

int BN_is_prime_ex ( const BIGNUM candidate,
int  checks,
BN_CTX ctx,
BN_GENCB cb 
)

Definition at line 774 of file prime.c.

◆ BN_is_prime_fasttest_ex()

int BN_is_prime_fasttest_ex ( const BIGNUM a,
int  checks,
BN_CTX ctx,
int  do_trial_division,
BN_GENCB cb 
)

Definition at line 779 of file prime.c.

◆ bn_miller_rabin_init()

int bn_miller_rabin_init ( BN_MILLER_RABIN miller_rabin,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 497 of file prime.c.

◆ bn_miller_rabin_iteration()

int bn_miller_rabin_iteration ( const BN_MILLER_RABIN miller_rabin,
int out_is_possibly_prime,
const BIGNUM b,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 536 of file prime.c.

◆ bn_odd_number_is_obviously_composite()

int bn_odd_number_is_obviously_composite ( const BIGNUM bn)

Definition at line 492 of file prime.c.

◆ BN_primality_test()

int BN_primality_test ( int out_is_probably_prime,
const BIGNUM w,
int  checks,
BN_CTX ctx,
int  do_trial_division,
BN_GENCB cb 
)

Definition at line 603 of file prime.c.

◆ BN_prime_checks_for_size()

static int BN_prime_checks_for_size ( int  bits)
static

Definition at line 260 of file prime.c.

◆ bn_trial_division()

static int bn_trial_division ( uint16_t out,
const BIGNUM bn 
)
static

Definition at line 481 of file prime.c.

◆ num_trial_division_primes()

static size_t num_trial_division_primes ( const BIGNUM n)
static

Definition at line 288 of file prime.c.

◆ probable_prime()

static int probable_prime ( BIGNUM rnd,
int  bits 
)
static

Definition at line 928 of file prime.c.

◆ probable_prime_dh()

static int probable_prime_dh ( BIGNUM rnd,
int  bits,
const BIGNUM add,
const BIGNUM rem,
BN_CTX ctx 
)
static

Definition at line 937 of file prime.c.

◆ probable_prime_dh_safe()

static int probable_prime_dh_safe ( BIGNUM rnd,
int  bits,
const BIGNUM add,
const BIGNUM rem,
BN_CTX ctx 
)
static

Definition at line 989 of file prime.c.

Variable Documentation

◆ kPrimes

const uint16_t kPrimes[]
static

Definition at line 119 of file prime.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:26