webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Typedefs | Functions
exponentiation.c File Reference
#include <openssl/bn.h>
#include <assert.h>
#include <string.h>
#include <openssl/cpu.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include "internal.h"

Classes

struct  bn_recp_ctx_st
 

Macros

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

Typedefs

typedef struct bn_recp_ctx_st BN_RECP_CTX
 

Functions

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_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)
 
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)
 
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)
 

Macro Definition Documentation

◆ BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE

#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE   (6)

◆ 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)

◆ BN_window_bits_for_exponent_size

#define BN_window_bits_for_exponent_size (   b)
Value:
((b) > 671 ? 6 : \
(b) > 239 ? 5 : \
(b) > 79 ? 4 : \
(b) > 23 ? 3 : 1)
GLboolean GLboolean GLboolean b
Definition: gl2ext.h:306

◆ MOD_EXP_CTIME_ALIGN

#define MOD_EXP_CTIME_ALIGN (   x_)
Value:
((unsigned char *)(x_) + \
#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK
Definition: exponentiation.c:826
std::integral_constant< std::size_t, V > size_t
Definition: Brigand.h:447
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH
Definition: exponentiation.c:825

◆ MOD_EXP_CTIME_MIN_CACHE_LINE_MASK

#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK   (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)

◆ MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH

#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH   (64)

◆ TABLE_SIZE [1/2]

#define TABLE_SIZE   32

◆ TABLE_SIZE [2/2]

#define TABLE_SIZE   32

Typedef Documentation

◆ BN_RECP_CTX

Function Documentation

◆ BN_exp()

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

◆ BN_mod_exp()

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

◆ 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 
)

◆ 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 
)

◆ 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 
)

◆ 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 
)