Classes | Macros | Typedefs | Functions
exponentiation.c File Reference
#include <openssl/bn.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/cpu.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include "internal.h"
#include "rsaz_exp.h"
Include dependency graph for exponentiation.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bn_recp_ctx_st
 

Macros

#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE   (6)
 
#define BN_window_bits_for_ctime_exponent_size(b)   ((b) > 937 ? 6 : (b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1)
 
#define MOD_EXP_CTIME_ALIGN(x_)
 
#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK   (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
 
#define TABLE_BITS_SMALL   5
 
#define TABLE_SIZE   32
 
#define TABLE_SIZE   32
 
#define TABLE_SIZE_SMALL   (1 << (TABLE_BITS_SMALL - 1))
 

Typedefs

typedef struct bn_recp_ctx_st BN_RECP_CTX
 

Functions

static int BN_div_recp (BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp, BN_CTX *ctx)
 
int BN_exp (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 
int BN_mod_exp (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx)
 
int BN_mod_exp2_mont (BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont)
 
int BN_mod_exp_mont (BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont)
 
int BN_mod_exp_mont_consttime (BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont)
 
void bn_mod_exp_mont_small (BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_ULONG *p, size_t num_p, const BN_MONT_CTX *mont)
 
int BN_mod_exp_mont_word (BIGNUM *rr, BN_ULONG a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont)
 
void bn_mod_inverse0_prime_mont_small (BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_MONT_CTX *mont)
 
static int BN_mod_mul_reciprocal (BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_RECP_CTX *recp, BN_CTX *ctx)
 
static int BN_reciprocal (BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)
 
static void BN_RECP_CTX_free (BN_RECP_CTX *recp)
 
static void BN_RECP_CTX_init (BN_RECP_CTX *recp)
 
static int BN_RECP_CTX_set (BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
 
static int BN_window_bits_for_exponent_size (int b)
 
static int copy_from_prebuf (BIGNUM *b, int top, const BN_ULONG *table, int idx, int window)
 
static void copy_to_prebuf (const BIGNUM *b, int top, BN_ULONG *table, int idx, int window)
 
static int mod_exp_recp (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx)
 

Macro Definition Documentation

◆ BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE

#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE   (6)

Definition at line 880 of file exponentiation.c.

◆ BN_window_bits_for_ctime_exponent_size

#define BN_window_bits_for_ctime_exponent_size (   b)    ((b) > 937 ? 6 : (b) > 306 ? 5 : (b) > 89 ? 4 : (b) > 22 ? 3 : 1)

Definition at line 878 of file exponentiation.c.

◆ MOD_EXP_CTIME_ALIGN

#define MOD_EXP_CTIME_ALIGN (   x_)
Value:
((unsigned char *)(x_) + \

Definition at line 892 of file exponentiation.c.

◆ MOD_EXP_CTIME_MIN_CACHE_LINE_MASK

#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK   (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)

Definition at line 862 of file exponentiation.c.

◆ TABLE_BITS_SMALL

#define TABLE_BITS_SMALL   5

Definition at line 424 of file exponentiation.c.

◆ TABLE_SIZE [1/2]

#define TABLE_SIZE   32

Definition at line 1251 of file exponentiation.c.

◆ TABLE_SIZE [2/2]

#define TABLE_SIZE   32

Definition at line 1251 of file exponentiation.c.

◆ TABLE_SIZE_SMALL

#define TABLE_SIZE_SMALL   (1 << (TABLE_BITS_SMALL - 1))

Definition at line 428 of file exponentiation.c.

Typedef Documentation

◆ BN_RECP_CTX

typedef struct bn_recp_ctx_st BN_RECP_CTX

Function Documentation

◆ BN_div_recp()

static int BN_div_recp ( BIGNUM dv,
BIGNUM rem,
const BIGNUM m,
BN_RECP_CTX recp,
BN_CTX ctx 
)
static

Definition at line 240 of file exponentiation.c.

◆ BN_exp()

int BN_exp ( BIGNUM r,
const BIGNUM a,
const BIGNUM p,
BN_CTX ctx 
)

Definition at line 123 of file exponentiation.c.

◆ BN_mod_exp()

int BN_mod_exp ( BIGNUM r,
const BIGNUM a,
const BIGNUM p,
const BIGNUM m,
BN_CTX ctx 
)

Definition at line 567 of file exponentiation.c.

◆ BN_mod_exp2_mont()

int BN_mod_exp2_mont ( BIGNUM rr,
const BIGNUM a1,
const BIGNUM p1,
const BIGNUM a2,
const BIGNUM p2,
const BIGNUM m,
BN_CTX ctx,
const BN_MONT_CTX mont 
)

Definition at line 1253 of file exponentiation.c.

◆ BN_mod_exp_mont()

int BN_mod_exp_mont ( BIGNUM rr,
const BIGNUM a,
const BIGNUM p,
const BIGNUM m,
BN_CTX ctx,
const BN_MONT_CTX mont 
)

Definition at line 587 of file exponentiation.c.

◆ BN_mod_exp_mont_consttime()

int BN_mod_exp_mont_consttime ( BIGNUM rr,
const BIGNUM a,
const BIGNUM p,
const BIGNUM m,
BN_CTX ctx,
const BN_MONT_CTX mont 
)

Definition at line 901 of file exponentiation.c.

◆ bn_mod_exp_mont_small()

void bn_mod_exp_mont_small ( BN_ULONG *  r,
const BN_ULONG *  a,
size_t  num,
const BN_ULONG *  p,
size_t  num_p,
const BN_MONT_CTX mont 
)

Definition at line 722 of file exponentiation.c.

◆ BN_mod_exp_mont_word()

int BN_mod_exp_mont_word ( BIGNUM rr,
BN_ULONG  a,
const BIGNUM p,
const BIGNUM m,
BN_CTX ctx,
const BN_MONT_CTX mont 
)

Definition at line 1225 of file exponentiation.c.

◆ bn_mod_inverse0_prime_mont_small()

void bn_mod_inverse0_prime_mont_small ( BN_ULONG *  r,
const BN_ULONG *  a,
size_t  num,
const BN_MONT_CTX mont 
)

Definition at line 812 of file exponentiation.c.

◆ BN_mod_mul_reciprocal()

static int BN_mod_mul_reciprocal ( BIGNUM r,
const BIGNUM x,
const BIGNUM y,
BN_RECP_CTX recp,
BN_CTX ctx 
)
static

Definition at line 343 of file exponentiation.c.

◆ BN_reciprocal()

static int BN_reciprocal ( BIGNUM r,
const BIGNUM m,
int  len,
BN_CTX ctx 
)
static

Definition at line 215 of file exponentiation.c.

◆ BN_RECP_CTX_free()

static void BN_RECP_CTX_free ( BN_RECP_CTX recp)
static

Definition at line 191 of file exponentiation.c.

◆ BN_RECP_CTX_init()

static void BN_RECP_CTX_init ( BN_RECP_CTX recp)
static

Definition at line 183 of file exponentiation.c.

◆ BN_RECP_CTX_set()

static int BN_RECP_CTX_set ( BN_RECP_CTX recp,
const BIGNUM d,
BN_CTX ctx 
)
static

Definition at line 200 of file exponentiation.c.

◆ BN_window_bits_for_exponent_size()

static int BN_window_bits_for_exponent_size ( int  b)
static

Definition at line 400 of file exponentiation.c.

◆ copy_from_prebuf()

static int copy_from_prebuf ( BIGNUM b,
int  top,
const BN_ULONG *  table,
int  idx,
int  window 
)
static

Definition at line 843 of file exponentiation.c.

◆ copy_to_prebuf()

static void copy_to_prebuf ( const BIGNUM b,
int  top,
BN_ULONG *  table,
int  idx,
int  window 
)
static

Definition at line 836 of file exponentiation.c.

◆ mod_exp_recp()

static int mod_exp_recp ( BIGNUM r,
const BIGNUM a,
const BIGNUM p,
const BIGNUM m,
BN_CTX ctx 
)
static

Definition at line 430 of file exponentiation.c.

x_
X x_
Definition: abseil-cpp/absl/strings/internal/str_format/arg_test.cc:35
MOD_EXP_CTIME_MIN_CACHE_LINE_MASK
#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK
Definition: exponentiation.c:862
MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h:194


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