OpenCore
1.0.4
OpenCore Bootloader
|
#include "BigNumLib.h"
Go to the source code of this file.
Functions | |
OC_BN_WORD | BigNumWordMul64 (OUT OC_BN_WORD *Hi, IN OC_BN_WORD A, IN OC_BN_WORD B) |
OC_BN_WORD | BigNumWordMul (OUT OC_BN_WORD *Hi, IN OC_BN_WORD A, IN OC_BN_WORD B) |
VOID | BigNumSub (IN OUT OC_BN_WORD *Result, IN OC_BN_NUM_WORDS NumWords, IN CONST OC_BN_WORD *A, IN CONST OC_BN_WORD *B) |
VOID | BigNumOrWord (IN OUT OC_BN_WORD *A, IN OC_BN_NUM_WORDS NumWords, IN OC_BN_WORD Value, IN UINTN Exponent) |
VOID | BigNumMod (IN OUT OC_BN_WORD *Result, IN OC_BN_NUM_WORDS NumWordsRest, IN CONST OC_BN_WORD *A, IN OC_BN_NUM_WORDS NumWordsA, IN CONST OC_BN_WORD *B, IN OC_BN_WORD *Scratch) |
INTN | BigNumCmp (IN CONST OC_BN_WORD *A, IN OC_BN_NUM_WORDS NumWords, IN CONST OC_BN_WORD *B) |
OC_BN_NUM_BITS | BigNumSignificantBits (IN CONST OC_BN_WORD *A, IN OC_BN_NUM_WORDS NumWords) |
INTN BigNumCmp | ( | IN CONST OC_BN_WORD * | A, |
IN OC_BN_NUM_WORDS | NumWords, | ||
IN CONST OC_BN_WORD * | B ) |
Returns the relative order of A and B. A and B must have the same precision.
[in] | A | The first number to compare. |
[in] | NumWords | The number of Words to compare. |
[in] | B | The second number to compare. |
< | 0 A is lower than B. |
0 | A is as big as B. |
> | 0 A is greater than B. |
Definition at line 540 of file BigNumPrimitives.c.
VOID BigNumMod | ( | IN OUT OC_BN_WORD * | Result, |
IN OC_BN_NUM_WORDS | NumWordsRest, | ||
IN CONST OC_BN_WORD * | A, | ||
IN OC_BN_NUM_WORDS | NumWordsA, | ||
IN CONST OC_BN_WORD * | B, | ||
IN OC_BN_WORD * | Scratch ) |
Calculates the remainder of A and B.
[in,out] | Result | The buffer to return the result into. |
[in] | NumWordsRest | The number of Words of Result and B. |
[in] | A | The dividend. |
[in] | NumWordsA | The number of Words of A. |
[in] | B | The divisor. |
[in] | Scratch | Scratch buffer 2 * OC_BN_SIZE (NumWordsA). |
Definition at line 566 of file BigNumPrimitives.c.
VOID BigNumOrWord | ( | IN OUT OC_BN_WORD * | A, |
IN OC_BN_NUM_WORDS | NumWords, | ||
IN OC_BN_WORD | Value, | ||
IN UINTN | Exponent ) |
Calculates the binary union of A and (Value << Exponent).
[in,out] | A | The number to OR with and store the result into. |
[in] | NumWords | The number of Words of A. |
[in] | Value | The Word value to OR with. |
[in] | Exponent | The Word shift exponent. |
Definition at line 518 of file BigNumPrimitives.c.
OC_BN_NUM_BITS BigNumSignificantBits | ( | IN CONST OC_BN_WORD * | A, |
IN OC_BN_NUM_WORDS | NumWords ) |
Returns the number of significant bits in a number. Logically matches OpenSSL's BN_num_bits.
[in] | A | The number to gather the number of significant bits of. |
[in] | NumWords | The number of Words of A. |
Definition at line 503 of file BigNumPrimitives.c.
VOID BigNumSub | ( | IN OUT OC_BN_WORD * | Result, |
IN OC_BN_NUM_WORDS | NumWords, | ||
IN CONST OC_BN_WORD * | A, | ||
IN CONST OC_BN_WORD * | B ) |
Calulates the difference of A and B. A must have the same precision as B. Result must have a precision at most as bit as A and B.
[in,out] | Result | The buffer to return the result into. |
[in] | NumWords | The number of Words of Result, minimum number of Words of A and B. |
[in] | A | The minuend. |
[in] | B | The subtrahend. |
Definition at line 404 of file BigNumPrimitives.c.
OC_BN_WORD BigNumWordMul | ( | OUT OC_BN_WORD * | Hi, |
IN OC_BN_WORD | A, | ||
IN OC_BN_WORD | B ) |
Calculates the product of A and B.
[out] | Hi | Buffer in which the high Word of the result is returned. |
[in] | A | The multiplicant. |
[in] | B | The multiplier. |
Definition at line 379 of file BigNumPrimitives.c.
OC_BN_WORD BigNumWordMul64 | ( | OUT OC_BN_WORD * | Hi, |
IN OC_BN_WORD | A, | ||
IN OC_BN_WORD | B ) |
Copyright (C) 2019, Download-Fritz. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Calculates the product of A and B.
[out] | Hi | Buffer in which the high Word of the result is returned. |
[in] | A | The multiplicant. |
[in] | B | The multiplier. |
Definition at line 17 of file BigNumWordMul64.c.