OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
bn_exp.c File Reference
#include "cryptlib.h"
#include "bn_lcl.h"
#include <stdlib.h>

Go to the source code of this file.

Macros

#define TABLE_SIZE   32
 
#define MONT_MUL_MOD
 
#define MONT_EXP_WORD
 
#define RECP_MUL_MOD
 
#define MOD_EXP_CTIME_ALIGN(x_)   ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
 
#define BN_MOD_MUL_WORD(r, w, m)
 
#define BN_TO_MONTGOMERY_WORD(r, w, mont)   (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), 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_recp (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, BN_MONT_CTX *in_mont)
 
int BN_mod_exp_mont_consttime (BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
 
int BN_mod_exp_mont_word (BIGNUM *rr, BN_ULONG a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
 
int BN_mod_exp_simple (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx)
 

Macro Definition Documentation

#define BN_MOD_MUL_WORD (   r,
  w,
 
)
Value:
(BN_mul_word(r, (w)) && \
(/* BN_ucmp(r, (m)) < 0 ? 1 :*/ \
(BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
#define BN_TO_MONTGOMERY_WORD (   r,
  w,
  mont 
)    (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
#define MOD_EXP_CTIME_ALIGN (   x_)    ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))

Definition at line 569 of file bn_exp.c.

#define MONT_EXP_WORD
#define MONT_MUL_MOD
#define RECP_MUL_MOD
#define TABLE_SIZE   32

Definition at line 129 of file bn_exp.c.

Function Documentation

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

Definition at line 132 of file bn_exp.c.

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

Definition at line 176 of file bn_exp.c.

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

Definition at line 384 of file bn_exp.c.

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

Definition at line 578 of file bn_exp.c.

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

Definition at line 832 of file bn_exp.c.

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

Definition at line 251 of file bn_exp.c.

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

Definition at line 983 of file bn_exp.c.