Big integer support.
More...
#include <stdint.h>
#include <string.h>
#include <ipxe/bigint.h>
Go to the source code of this file.
Big integer support.
Definition in file x86_bigint.c.
◆ FILE_LICENCE()
FILE_LICENCE |
( |
GPL2_OR_LATER_OR_UBDL |
| ) |
|
◆ bigint_multiply_raw()
void bigint_multiply_raw |
( |
const uint32_t * |
multiplicand0, |
|
|
unsigned int |
multiplicand_size, |
|
|
const uint32_t * |
multiplier0, |
|
|
unsigned int |
multiplier_size, |
|
|
uint32_t * |
result0 |
|
) |
| |
Multiply big integers.
- Parameters
-
multiplicand0 | Element 0 of big integer to be multiplied |
multiplicand_size | Number of elements in multiplicand |
multiplier0 | Element 0 of big integer to be multiplied |
multiplier_size | Number of elements in multiplier |
result0 | Element 0 of big integer to hold result |
Definition at line 44 of file x86_bigint.c.
49 unsigned int result_size = ( multiplicand_size + multiplier_size );
51 *multiplicand = ( (
const void * ) multiplicand0 );
53 *
multiplier = ( (
const void * ) multiplier0 );
55 *
result = ( (
void * ) result0 );
69 for ( i = 0 ; i < multiplicand_size ; i++ ) {
70 multiplicand_element = multiplicand->element[i];
71 for ( j = 0 ; j < multiplier_size ; j++ ) {
73 result_elements = &
result->element[ i + j ];
83 "addl %%eax, (%6,%2,4)\n\t" 84 "adcl %%edx, 4(%6,%2,4)\n\t" 86 "adcl $0, 8(%6,%2,4)\n\t" 90 :
"=&a" ( discard_a ),
94 :
"0" ( multiplicand_element ),
95 "g" ( multiplier_element ),
96 "r" ( result_elements ),
static const void const void void * result
uint8_t multiplier
Port multiplier number.
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
uint64_t index
Index of the first segment within the content.
typedef bigint_t(X25519_SIZE) x25519_t
An X25519 unsigned big integer used in internal calculations.
void * memset(void *dest, int character, size_t len) __nonnull
References __asm__(), __attribute__, __volatile__(), bigint_t(), index, memset(), multiplier, and result.