iPXE
|
Big integer support. More...
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <ipxe/profile.h>
#include <ipxe/bigint.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | bigint_swap_raw (bigint_element_t *first0, bigint_element_t *second0, unsigned int size, int swap) |
Conditionally swap big integers (in constant time) More... | |
void | bigint_mod_multiply_raw (const bigint_element_t *multiplicand0, const bigint_element_t *multiplier0, const bigint_element_t *modulus0, bigint_element_t *result0, unsigned int size, void *tmp) |
Perform modular multiplication of big integers. More... | |
void | bigint_mod_exp_raw (const bigint_element_t *base0, const bigint_element_t *modulus0, const bigint_element_t *exponent0, bigint_element_t *result0, unsigned int size, unsigned int exponent_size, void *tmp) |
Perform modular exponentiation of big integers. More... | |
Variables | |
static struct profiler bigint_mod_multiply_profiler | __profiler |
Modular multiplication overall profiler. More... | |
Big integer support.
Definition in file bigint.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void bigint_swap_raw | ( | bigint_element_t * | first0, |
bigint_element_t * | second0, | ||
unsigned int | size, | ||
int | swap | ||
) |
void bigint_mod_multiply_raw | ( | const bigint_element_t * | multiplicand0, |
const bigint_element_t * | multiplier0, | ||
const bigint_element_t * | modulus0, | ||
bigint_element_t * | result0, | ||
unsigned int | size, | ||
void * | tmp | ||
) |
Perform modular multiplication of big integers.
multiplicand0 | Element 0 of big integer to be multiplied |
multiplier0 | Element 0 of big integer to be multiplied |
modulus0 | Element 0 of big integer modulus |
result0 | Element 0 of big integer to hold result |
size | Number of elements in base, modulus, and result |
tmp | Temporary working space |
Definition at line 88 of file bigint.c.
References __attribute__, assert(), bigint_grow, bigint_is_geq, bigint_max_set_bit, bigint_mod_multiply_tmp_len, bigint_multiply, bigint_rol, bigint_ror, bigint_shrink, bigint_subtract, bigint_t(), multiplier, profile_start(), profile_stop(), result, rotation, size, and tmp.
void bigint_mod_exp_raw | ( | const bigint_element_t * | base0, |
const bigint_element_t * | modulus0, | ||
const bigint_element_t * | exponent0, | ||
bigint_element_t * | result0, | ||
unsigned int | size, | ||
unsigned int | exponent_size, | ||
void * | tmp | ||
) |
Perform modular exponentiation of big integers.
base0 | Element 0 of big integer base |
modulus0 | Element 0 of big integer modulus |
exponent0 | Element 0 of big integer exponent |
result0 | Element 0 of big integer to hold result |
size | Number of elements in base, modulus, and result |
exponent_size | Number of elements in exponent |
tmp | Temporary working space |
Definition at line 158 of file bigint.c.
References __attribute__, base, bigint_bit_is_set, bigint_init, bigint_is_zero, bigint_mod_multiply, bigint_mod_multiply_tmp_len, bigint_ror, bigint_t(), memcpy(), result, size, start, and tmp.
|
static |