Functions
montgomery.c File Reference
#include <openssl/bn.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/thread.h>
#include <openssl/type_check.h>
#include "internal.h"
#include "../../internal.h"
Include dependency graph for montgomery.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int BN_from_montgomery (BIGNUM *r, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
static int bn_from_montgomery_in_place (BN_ULONG *r, size_t num_r, BN_ULONG *a, size_t num_a, const BN_MONT_CTX *mont)
 
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)
 
static int BN_from_montgomery_word (BIGNUM *ret, BIGNUM *r, const BN_MONT_CTX *mont)
 
int bn_less_than_montgomery_R (const BIGNUM *bn, const BN_MONT_CTX *mont)
 
int BN_mod_mul_montgomery (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
static int bn_mod_mul_montgomery_fallback (BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BN_MONT_CTX *mont, 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)
 
BN_MONT_CTXBN_MONT_CTX_copy (BN_MONT_CTX *to, const BN_MONT_CTX *from)
 
void BN_MONT_CTX_free (BN_MONT_CTX *mont)
 
BN_MONT_CTXBN_MONT_CTX_new (void)
 
BN_MONT_CTXBN_MONT_CTX_new_consttime (const BIGNUM *mod, BN_CTX *ctx)
 
BN_MONT_CTXBN_MONT_CTX_new_for_modulus (const BIGNUM *mod, BN_CTX *ctx)
 
int BN_MONT_CTX_set (BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
 
int BN_MONT_CTX_set_locked (BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, const BIGNUM *mod, BN_CTX *bn_ctx)
 
static int bn_mont_ctx_set_N_and_n0 (BN_MONT_CTX *mont, const BIGNUM *mod)
 
int bn_one_to_montgomery (BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
int BN_to_montgomery (BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx)
 
void bn_to_montgomery_small (BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_MONT_CTX *mont)
 

Function Documentation

◆ BN_from_montgomery()

int BN_from_montgomery ( BIGNUM r,
const BIGNUM a,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 343 of file montgomery.c.

◆ bn_from_montgomery_in_place()

static int bn_from_montgomery_in_place ( BN_ULONG *  r,
size_t  num_r,
BN_ULONG *  a,
size_t  num_a,
const BN_MONT_CTX mont 
)
static

Definition at line 288 of file montgomery.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_from_montgomery_word()

static int BN_from_montgomery_word ( BIGNUM ret,
BIGNUM r,
const BN_MONT_CTX mont 
)
static

Definition at line 319 of file montgomery.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_mod_mul_montgomery()

int BN_mod_mul_montgomery ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 417 of file montgomery.c.

◆ bn_mod_mul_montgomery_fallback()

static int bn_mod_mul_montgomery_fallback ( BIGNUM r,
const BIGNUM a,
const BIGNUM b,
const BN_MONT_CTX mont,
BN_CTX ctx 
)
static

Definition at line 383 of file montgomery.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_MONT_CTX_copy()

BN_MONT_CTX* BN_MONT_CTX_copy ( BN_MONT_CTX to,
const BN_MONT_CTX from 
)

Definition at line 149 of file montgomery.c.

◆ BN_MONT_CTX_free()

void BN_MONT_CTX_free ( BN_MONT_CTX mont)

Definition at line 139 of file montgomery.c.

◆ BN_MONT_CTX_new()

BN_MONT_CTX* BN_MONT_CTX_new ( void  )

Definition at line 125 of file montgomery.c.

◆ BN_MONT_CTX_new_consttime()

BN_MONT_CTX* BN_MONT_CTX_new_consttime ( const BIGNUM mod,
BN_CTX ctx 
)

Definition at line 246 of file montgomery.c.

◆ BN_MONT_CTX_new_for_modulus()

BN_MONT_CTX* BN_MONT_CTX_new_for_modulus ( const BIGNUM mod,
BN_CTX ctx 
)

Definition at line 236 of file montgomery.c.

◆ BN_MONT_CTX_set()

int BN_MONT_CTX_set ( BN_MONT_CTX mont,
const BIGNUM mod,
BN_CTX ctx 
)

Definition at line 208 of file montgomery.c.

◆ BN_MONT_CTX_set_locked()

int BN_MONT_CTX_set_locked ( BN_MONT_CTX **  pmont,
CRYPTO_MUTEX lock,
const BIGNUM mod,
BN_CTX bn_ctx 
)

Definition at line 264 of file montgomery.c.

◆ bn_mont_ctx_set_N_and_n0()

static int bn_mont_ctx_set_N_and_n0 ( BN_MONT_CTX mont,
const BIGNUM mod 
)
static

Definition at line 163 of file montgomery.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_to_montgomery()

int BN_to_montgomery ( BIGNUM ret,
const BIGNUM a,
const BN_MONT_CTX mont,
BN_CTX ctx 
)

Definition at line 283 of file montgomery.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.



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