8#include "InternalCryptLib.h"
40 return BN_bin2bn (Buf, (INT32)Len,
NULL);
59 return BN_bn2bin (Bn, Buf);
102 return (BOOLEAN)BN_add (BnRes, BnA, BnB);
125 return (BOOLEAN)BN_sub (BnRes, BnA, BnB);
156 RetVal = (BOOLEAN)BN_mod (BnRes, BnA, BnB, Ctx);
192 RetVal = (BOOLEAN)BN_mod_exp (BnRes, BnA, BnP, BnM, Ctx);
227 if (BN_mod_inverse (BnRes, BnA, BnM, Ctx) !=
NULL) {
263 RetVal = (BOOLEAN)BN_div (BnRes,
NULL, BnA, BnB, Ctx);
299 RetVal = (BOOLEAN)BN_mod_mul (BnRes, BnA, BnB, BnM, Ctx);
322 return BN_cmp (BnA, BnB);
338 return BN_num_bits (Bn);
354 return BN_num_bytes (Bn);
373 return (BOOLEAN)BN_is_word (Bn, Num);
390 return (BOOLEAN)BN_is_odd (Bn);
409 return BN_copy (BnDst, BnSrc);
424 return BN_value_one ();
447 return (BOOLEAN)BN_rshift (BnRes, Bn, (INT32)N);
463 BN_set_flags (Bn, BN_FLG_CONSTTIME);
494 RetVal = (BOOLEAN)BN_mod_sqr (BnRes, BnA, BnM, Ctx);
513 return BN_CTX_new ();
546 return (BOOLEAN)BN_set_word (Bn, Val);
577 RetVal = (BOOLEAN)BN_mod_add (BnRes, BnA, BnB, BnM, Ctx);
BOOLEAN EFIAPI BigNumExpMod(IN CONST VOID *BnA, IN CONST VOID *BnP, IN CONST VOID *BnM, OUT VOID *BnRes)
BOOLEAN EFIAPI BigNumMulMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
BOOLEAN EFIAPI BigNumInverseMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
VOID *EFIAPI BigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
BOOLEAN EFIAPI BigNumDiv(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
BOOLEAN EFIAPI BigNumSqrMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
UINTN EFIAPI BigNumBits(IN CONST VOID *Bn)
VOID *EFIAPI BigNumNewContext(VOID)
VOID EFIAPI BigNumFree(IN VOID *Bn, IN BOOLEAN Clear)
BOOLEAN EFIAPI BigNumIsWord(IN CONST VOID *Bn, IN UINTN Num)
INTN EFIAPI BigNumCmp(IN CONST VOID *BnA, IN CONST VOID *BnB)
BOOLEAN EFIAPI BigNumAdd(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
VOID EFIAPI BigNumConstTime(IN VOID *Bn)
CONST VOID *EFIAPI BigNumValueOne(VOID)
BOOLEAN EFIAPI BigNumSetUint(IN VOID *Bn, IN UINTN Val)
VOID EFIAPI BigNumContextFree(IN VOID *BnCtx)
BOOLEAN EFIAPI BigNumIsOdd(IN CONST VOID *Bn)
BOOLEAN EFIAPI BigNumSub(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
VOID *EFIAPI BigNumCopy(OUT VOID *BnDst, IN CONST VOID *BnSrc)
BOOLEAN EFIAPI BigNumAddMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
BOOLEAN EFIAPI BigNumMod(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
VOID *EFIAPI BigNumInit(VOID)
BOOLEAN EFIAPI BigNumRShift(IN CONST VOID *Bn, IN UINTN N, OUT VOID *BnRes)
UINTN EFIAPI BigNumBytes(IN CONST VOID *Bn)
INTN EFIAPI BigNumToBin(IN CONST VOID *Bn, OUT UINT8 *Buf)