Classes | Macros | Functions
third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h File Reference
#include <openssl/bn.h>
#include "../../internal.h"
Include dependency graph for third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BN_MILLER_RABIN
 

Macros

#define BN_SMALL_MAX_WORDS   9
 
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH   64
 
#define MOD_EXP_CTIME_STORAGE_LEN   (((320u * 3u) + (32u * 9u * 16u)) / sizeof(BN_ULONG))
 
#define STATIC_BIGNUM(x)
 

Functions

OPENSSL_EXPORT int bn_abs_sub_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
BN_ULONG bn_add_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, size_t num)
 
int bn_copy_words (BN_ULONG *out, size_t num, const BIGNUM *bn)
 
OPENSSL_EXPORT int bn_div_consttime (BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, const BIGNUM *divisor, unsigned divisor_min_bits, BN_CTX *ctx)
 
int bn_expand (BIGNUM *bn, size_t bits)
 
int bn_fits_in_words (const BIGNUM *bn, size_t num)
 
void bn_from_montgomery_small (BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, const BN_MONT_CTX *mont)
 
int bn_in_range_words (const BN_ULONG *a, BN_ULONG min_inclusive, const BN_ULONG *max_exclusive, size_t len)
 
int bn_is_bit_set_words (const BN_ULONG *a, size_t num, unsigned bit)
 
OPENSSL_EXPORT int bn_is_relatively_prime (int *out_relatively_prime, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
 
int bn_jacobi (const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
OPENSSL_EXPORT int bn_lcm_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
int bn_less_than_montgomery_R (const BIGNUM *bn, const BN_MONT_CTX *mont)
 
int bn_less_than_words (const BN_ULONG *a, const BN_ULONG *b, size_t len)
 
OPENSSL_EXPORT int bn_miller_rabin_init (BN_MILLER_RABIN *miller_rabin, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
OPENSSL_EXPORT 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_minimal_width (const BIGNUM *bn)
 
int bn_mod_add_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
 
void bn_mod_add_words (BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, const BN_ULONG *m, BN_ULONG *tmp, size_t num)
 
int bn_mod_exp_base_2_consttime (BIGNUM *r, unsigned p, const BIGNUM *n, BN_CTX *ctx)
 
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)
 
void bn_mod_inverse0_prime_mont_small (BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_MONT_CTX *mont)
 
OPENSSL_EXPORT int bn_mod_inverse_consttime (BIGNUM *r, int *out_no_inverse, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
 
int bn_mod_inverse_prime (BIGNUM *out, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx, const BN_MONT_CTX *mont_p)
 
int bn_mod_inverse_secret_prime (BIGNUM *out, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx, const BN_MONT_CTX *mont_p)
 
int bn_mod_lshift1_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
 
int bn_mod_lshift_consttime (BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx)
 
void bn_mod_mul_montgomery_small (BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, size_t num, const BN_MONT_CTX *mont)
 
int bn_mod_sub_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
 
void bn_mod_sub_words (BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, const BN_ULONG *m, BN_ULONG *tmp, size_t num)
 
OPENSSL_EXPORT uint16_t bn_mod_u16_consttime (const BIGNUM *bn, uint16_t d)
 
uint64_t bn_mont_n0 (const BIGNUM *n)
 
BN_ULONG bn_mul_add_words (BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w)
 
void bn_mul_comba4 (BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4])
 
void bn_mul_comba8 (BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8])
 
int bn_mul_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
void bn_mul_small (BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, const BN_ULONG *b, size_t num_b)
 
BN_ULONG bn_mul_words (BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w)
 
int bn_odd_number_is_obviously_composite (const BIGNUM *bn)
 
int bn_one_to_montgomery (BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
int bn_rand_range_words (BN_ULONG *out, BN_ULONG min_inclusive, const BN_ULONG *max_exclusive, size_t len, const uint8_t additional_data[32])
 
int bn_rand_secret_range (BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, const BIGNUM *max_exclusive)
 
BN_ULONG bn_reduce_once (BN_ULONG *r, const BN_ULONG *a, BN_ULONG carry, const BN_ULONG *m, size_t num)
 
BN_ULONG bn_reduce_once_in_place (BN_ULONG *r, BN_ULONG carry, const BN_ULONG *m, BN_ULONG *tmp, size_t num)
 
OPENSSL_EXPORT int bn_resize_words (BIGNUM *bn, size_t words)
 
void bn_rshift1_words (BN_ULONG *r, const BN_ULONG *a, size_t num)
 
OPENSSL_EXPORT int bn_rshift_secret_shift (BIGNUM *r, const BIGNUM *a, unsigned n, BN_CTX *ctx)
 
void bn_rshift_words (BN_ULONG *r, const BN_ULONG *a, unsigned shift, size_t num)
 
void bn_select_words (BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, const BN_ULONG *b, size_t num)
 
void bn_set_minimal_width (BIGNUM *bn)
 
void bn_set_static_words (BIGNUM *bn, const BN_ULONG *words, size_t num)
 
int bn_set_words (BIGNUM *bn, const BN_ULONG *words, size_t num)
 
void bn_sqr_comba4 (BN_ULONG r[8], const BN_ULONG a[4])
 
void bn_sqr_comba8 (BN_ULONG r[16], const BN_ULONG a[8])
 
int bn_sqr_consttime (BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
 
void bn_sqr_small (BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a)
 
void bn_sqr_words (BN_ULONG *rp, const BN_ULONG *ap, size_t num)
 
BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, size_t num)
 
void bn_to_montgomery_small (BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_MONT_CTX *mont)
 
int bn_uadd_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 
int bn_usub_consttime (BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 
int bn_wexpand (BIGNUM *bn, size_t words)
 

Macro Definition Documentation

◆ BN_SMALL_MAX_WORDS

#define BN_SMALL_MAX_WORDS   9

◆ MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH

#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH   64

◆ MOD_EXP_CTIME_STORAGE_LEN

#define MOD_EXP_CTIME_STORAGE_LEN   (((320u * 3u) + (32u * 9u * 16u)) / sizeof(BN_ULONG))

◆ STATIC_BIGNUM

#define STATIC_BIGNUM (   x)
Value:
{ \
(BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \
sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \
}

Definition at line 203 of file third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h.

Function Documentation

◆ bn_abs_sub_consttime()

OPENSSL_EXPORT int bn_abs_sub_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
BN_CTX ctx 
)

Definition at line 182 of file mul.c.

◆ bn_add_words()

BN_ULONG bn_add_words ( BN_ULONG *  rp,
const BN_ULONG *  ap,
const BN_ULONG *  bp,
size_t  num 
)

Definition at line 245 of file generic.c.

◆ bn_copy_words()

int bn_copy_words ( BN_ULONG *  out,
size_t  num,
const BIGNUM bn 
)

Definition at line 307 of file bn.c.

◆ bn_div_consttime()

OPENSSL_EXPORT int bn_div_consttime ( BIGNUM quotient,
BIGNUM remainder,
const BIGNUM numerator,
const BIGNUM divisor,
unsigned  divisor_min_bits,
BN_CTX ctx 
)

Definition at line 457 of file div.c.

◆ bn_expand()

int bn_expand ( BIGNUM bn,
size_t  bits 
)

Definition at line 371 of file bn.c.

◆ bn_fits_in_words()

int bn_fits_in_words ( const BIGNUM bn,
size_t  num 
)

Definition at line 298 of file bn.c.

◆ bn_from_montgomery_small()

void bn_from_montgomery_small ( BN_ULONG *  r,
size_t  num_r,
const BN_ULONG *  a,
size_t  num_a,
const BN_MONT_CTX mont 
)

Definition at line 458 of file montgomery.c.

◆ bn_in_range_words()

int bn_in_range_words ( const BN_ULONG *  a,
BN_ULONG  min_inclusive,
const BN_ULONG *  max_exclusive,
size_t  len 
)

◆ bn_is_bit_set_words()

int bn_is_bit_set_words ( const BN_ULONG *  a,
size_t  num,
unsigned  bit 
)

Definition at line 261 of file shift.c.

◆ bn_is_relatively_prime()

OPENSSL_EXPORT int bn_is_relatively_prime ( int out_relatively_prime,
const BIGNUM x,
const BIGNUM y,
BN_CTX ctx 
)

Definition at line 128 of file gcd_extra.c.

◆ bn_jacobi()

int bn_jacobi ( const BIGNUM a,
const BIGNUM b,
BN_CTX ctx 
)

Definition at line 63 of file jacobi.c.

◆ bn_lcm_consttime()

OPENSSL_EXPORT int bn_lcm_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
BN_CTX ctx 
)

Definition at line 156 of file gcd_extra.c.

◆ bn_less_than_montgomery_R()

int bn_less_than_montgomery_R ( const BIGNUM bn,
const BN_MONT_CTX mont 
)

Definition at line 448 of file montgomery.c.

◆ bn_less_than_words()

int bn_less_than_words ( const BN_ULONG *  a,
const BN_ULONG *  b,
size_t  len 
)

Definition at line 126 of file cmp.c.

◆ bn_miller_rabin_init()

OPENSSL_EXPORT 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()

OPENSSL_EXPORT 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_minimal_width()

int bn_minimal_width ( const BIGNUM bn)

Definition at line 425 of file bn.c.

◆ bn_mod_add_consttime()

int bn_mod_add_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
const BIGNUM m,
BN_CTX ctx 
)

Definition at line 597 of file div.c.

◆ bn_mod_add_words()

void bn_mod_add_words ( BN_ULONG *  r,
const BN_ULONG *  a,
const BN_ULONG *  b,
const BN_ULONG *  m,
BN_ULONG *  tmp,
size_t  num 
)

Definition at line 451 of file div.c.

◆ bn_mod_exp_base_2_consttime()

int bn_mod_exp_base_2_consttime ( BIGNUM r,
unsigned  p,
const BIGNUM n,
BN_CTX ctx 
)

Definition at line 163 of file montgomery_inv.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_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_inverse_consttime()

OPENSSL_EXPORT int bn_mod_inverse_consttime ( BIGNUM r,
int out_no_inverse,
const BIGNUM a,
const BIGNUM n,
BN_CTX ctx 
)

Definition at line 170 of file gcd_extra.c.

◆ bn_mod_inverse_prime()

int bn_mod_inverse_prime ( BIGNUM out,
const BIGNUM a,
const BIGNUM p,
BN_CTX ctx,
const BN_MONT_CTX mont_p 
)

Definition at line 356 of file gcd.c.

◆ bn_mod_inverse_secret_prime()

int bn_mod_inverse_secret_prime ( BIGNUM out,
const BIGNUM a,
const BIGNUM p,
BN_CTX ctx,
const BN_MONT_CTX mont_p 
)

Definition at line 368 of file gcd.c.

◆ bn_mod_lshift1_consttime()

int bn_mod_lshift1_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM m,
BN_CTX ctx 
)

Definition at line 741 of file div.c.

◆ bn_mod_lshift_consttime()

int bn_mod_lshift_consttime ( BIGNUM r,
const BIGNUM a,
int  n,
const BIGNUM m,
BN_CTX ctx 
)

Definition at line 712 of file div.c.

◆ bn_mod_mul_montgomery_small()

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

Definition at line 472 of file montgomery.c.

◆ bn_mod_sub_consttime()

int bn_mod_sub_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
const BIGNUM m,
BN_CTX ctx 
)

Definition at line 622 of file div.c.

◆ bn_mod_sub_words()

void bn_mod_sub_words ( BN_ULONG *  r,
const BN_ULONG *  a,
const BN_ULONG *  b,
const BN_ULONG *  m,
BN_ULONG *  tmp,
size_t  num 
)

Definition at line 442 of file div.c.

◆ bn_mod_u16_consttime()

OPENSSL_EXPORT uint16_t bn_mod_u16_consttime ( const BIGNUM bn,
uint16_t  d 
)

Definition at line 62 of file div_extra.c.

◆ bn_mont_n0()

uint64_t bn_mont_n0 ( const BIGNUM n)

Definition at line 34 of file montgomery_inv.c.

◆ bn_mul_add_words()

BN_ULONG bn_mul_add_words ( BN_ULONG *  rp,
const BN_ULONG *  ap,
size_t  num,
BN_ULONG  w 
)

Definition at line 128 of file generic.c.

◆ bn_mul_comba4()

void bn_mul_comba4 ( BN_ULONG  r[8],
const BN_ULONG  a[4],
const BN_ULONG  b[4] 
)

Definition at line 559 of file generic.c.

◆ bn_mul_comba8()

void bn_mul_comba8 ( BN_ULONG  r[16],
const BN_ULONG  a[8],
const BN_ULONG  b[8] 
)

Definition at line 457 of file generic.c.

◆ bn_mul_consttime()

int bn_mul_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
BN_CTX ctx 
)

Definition at line 526 of file mul.c.

◆ bn_mul_small()

void bn_mul_small ( BN_ULONG *  r,
size_t  num_r,
const BN_ULONG *  a,
size_t  num_a,
const BN_ULONG *  b,
size_t  num_b 
)

Definition at line 536 of file mul.c.

◆ bn_mul_words()

BN_ULONG bn_mul_words ( BN_ULONG *  rp,
const BN_ULONG *  ap,
size_t  num,
BN_ULONG  w 
)

Definition at line 156 of file generic.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_one_to_montgomery()

int bn_one_to_montgomery ( BIGNUM r,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 363 of file montgomery.c.

◆ bn_rand_range_words()

int bn_rand_range_words ( BN_ULONG *  out,
BN_ULONG  min_inclusive,
const BN_ULONG *  max_exclusive,
size_t  len,
const uint8_t  additional_data[32] 
)

◆ bn_rand_secret_range()

int bn_rand_secret_range ( BIGNUM r,
int out_is_uniform,
BN_ULONG  min_inclusive,
const BIGNUM max_exclusive 
)

◆ bn_reduce_once()

BN_ULONG bn_reduce_once ( BN_ULONG *  r,
const BN_ULONG *  a,
BN_ULONG  carry,
const BN_ULONG *  m,
size_t  num 
)

Definition at line 413 of file div.c.

◆ bn_reduce_once_in_place()

BN_ULONG bn_reduce_once_in_place ( BN_ULONG *  r,
BN_ULONG  carry,
const BN_ULONG *  m,
BN_ULONG *  tmp,
size_t  num 
)

Definition at line 433 of file div.c.

◆ bn_resize_words()

OPENSSL_EXPORT int bn_resize_words ( BIGNUM bn,
size_t  words 
)

Definition at line 379 of file bn.c.

◆ bn_rshift1_words()

void bn_rshift1_words ( BN_ULONG *  r,
const BN_ULONG *  a,
size_t  num 
)

Definition at line 200 of file shift.c.

◆ bn_rshift_secret_shift()

OPENSSL_EXPORT int bn_rshift_secret_shift ( BIGNUM r,
const BIGNUM a,
unsigned  n,
BN_CTX ctx 
)

Definition at line 172 of file shift.c.

◆ bn_rshift_words()

void bn_rshift_words ( BN_ULONG *  r,
const BN_ULONG *  a,
unsigned  shift,
size_t  num 
)

Definition at line 136 of file shift.c.

◆ bn_select_words()

void bn_select_words ( BN_ULONG *  r,
BN_ULONG  mask,
const BN_ULONG *  a,
const BN_ULONG *  b,
size_t  num 
)

Definition at line 416 of file bn.c.

◆ bn_set_minimal_width()

void bn_set_minimal_width ( BIGNUM bn)

Definition at line 433 of file bn.c.

◆ bn_set_static_words()

void bn_set_static_words ( BIGNUM bn,
const BN_ULONG *  words,
size_t  num 
)

Definition at line 286 of file bn.c.

◆ bn_set_words()

int bn_set_words ( BIGNUM bn,
const BN_ULONG *  words,
size_t  num 
)

Definition at line 275 of file bn.c.

◆ bn_sqr_comba4()

void bn_sqr_comba4 ( BN_ULONG  r[8],
const BN_ULONG  a[4] 
)

Definition at line 671 of file generic.c.

◆ bn_sqr_comba8()

void bn_sqr_comba8 ( BN_ULONG  r[16],
const BN_ULONG  a[8] 
)

Definition at line 597 of file generic.c.

◆ bn_sqr_consttime()

int bn_sqr_consttime ( BIGNUM r,
const BIGNUM a,
BN_CTX ctx 
)

Definition at line 669 of file mul.c.

◆ bn_sqr_small()

void bn_sqr_small ( BN_ULONG *  r,
size_t  num_r,
const BN_ULONG *  a,
size_t  num_a 
)

Definition at line 736 of file mul.c.

◆ bn_sqr_words()

void bn_sqr_words ( BN_ULONG *  rp,
const BN_ULONG *  ap,
size_t  num 
)

Definition at line 182 of file generic.c.

◆ bn_sub_words()

BN_ULONG bn_sub_words ( BN_ULONG *  rp,
const BN_ULONG *  ap,
const BN_ULONG *  bp,
size_t  num 
)

Definition at line 301 of file generic.c.

◆ bn_to_montgomery_small()

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

Definition at line 453 of file montgomery.c.

◆ bn_uadd_consttime()

int bn_uadd_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b 
)

Definition at line 103 of file add.c.

◆ bn_usub_consttime()

int bn_usub_consttime ( BIGNUM r,
const BIGNUM a,
const BIGNUM b 
)

Definition at line 226 of file add.c.

◆ bn_wexpand()

int bn_wexpand ( BIGNUM bn,
size_t  words 
)

Definition at line 339 of file bn.c.

BN_FLG_STATIC_DATA
#define BN_FLG_STATIC_DATA
Definition: bn.h:997
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610


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