亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? opensslbnwrap.c

?? IBE是一種非對稱密碼技術
?? C
?? 第 1 頁 / 共 3 頁
字號:

  /* If NULL, we can't log an error, no libCtx.
   * We could check for one NULL, the other not, but this is the kind
   * of error an app expects not to log.
   */
  if ( (leftInt == (VoltMpInt *)0) || (rightInt == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  VOLT_SET_FNCT_LINE (fnctLine)
  if (result != (int *)0)
  {
    bnResult = BN_cmp (
      (BIGNUM *)(leftInt->mpInt), (BIGNUM *)(rightInt->mpInt));
    *result = 0;
    if (bnResult < 0)
      *result = -1;
    else if (bnResult > 0)
      *result = 1;

    return (0);
  }

  VOLT_LOG_ERROR (
    leftInt->mpCtx->voltObject.libraryCtx, VT_ERROR_NULL_ARG,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapCompare", (char *)0)

  return (VT_ERROR_NULL_ARG);
}

int OpenSSLBnWrapEvenOddZeroPositiveNegative (
   VoltMpInt *theInt,
   int *result
   )
{
  int retVal;
  BIGNUM *theBn;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  theBn = (BIGNUM *)(theInt->mpInt);

  VOLT_SET_FNCT_LINE (fnctLine)
  if (result != (int *)0)
  {
    /* BN_is_zero returns 0 if the number is not zero and 1 if the number
     * is zero. So init the result to 0 (for this function, if the number
     * is zero, the result is 0) and if the return from BN_is_zero is not
     * 0, then the number is zero, result is what it should be so return.
     */
    *result = 0;
    retVal = BN_is_zero (theBn);
    if (retVal != 0)
      return (0);

    /* BN_is_odd returns 1 if the number is odd and 0 if the number is
     * not odd.
     */
    retVal = BN_is_odd (theBn);
    if (retVal != 1)
      retVal = 2;

    /* retVal is now 1 or 2. If the source is negative, negate the retVal.
     * To get the sign, we can't treat the bn as an opaque type. So long
     * as the definition of BIGNUM does not change, this will work.
     * Inside a BIGNUM, if neg is 0, the number is positive, if neg is 1,
     * the number is negative.
     */
    if (theBn->neg != 0)
      retVal = -retVal;

    *result = retVal;
    return (0);
  }

  VOLT_LOG_ERROR (
    theInt->mpCtx->voltObject.libraryCtx, VT_ERROR_NULL_ARG,
    VT_ERROR_TYPE_PRIMARY, fnctLine,
    "OpenSSLBnWrapEvenOddZeroPositiveNegative", (char *)0)

  return (VT_ERROR_NULL_ARG);
}

int OpenSSLBnWrapGetBitLength (
   VoltMpInt *theInt,
   unsigned int *bitLen
   )
{
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  VOLT_SET_FNCT_LINE (fnctLine)
  if (bitLen != (unsigned int *)0)
  {
    /* How big is the integer?
     */
    *bitLen = (unsigned int)BN_num_bits ((BIGNUM *)(theInt->mpInt));
    if (*bitLen == 0)
      *bitLen = 1;

    return (0);
  }

  VOLT_LOG_ERROR (
    theInt->mpCtx->voltObject.libraryCtx, VT_ERROR_NULL_ARG,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapGetBitLength", (char *)0)

  return (VT_ERROR_NULL_ARG);
}

int OpenSSLBnWrapSetBit (
   VoltMpInt *theInt,
   unsigned int bitIndex,
   unsigned int value
   )
{
  int status;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  do
  {
    status = 0;

    /* If the value is 0, clear the bit.
     */
    if (value == 0)
    {
      /* This function returns 1 for success, 0 for failure. However, the
       * failure is if the index is out of range, which the MpInt chooses
       * to ignore (the bit is already clear).
       */
      BN_clear_bit ((BIGNUM *)(theInt->mpInt), (int)bitIndex);
      break;
    }

    /* If value is not 0, set the bit.
     * This function returns 1 for success, 0 for failure.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_set_bit ((BIGNUM *)(theInt->mpInt), (int)bitIndex) != 0)
      break;

    /* If there was an error, it was likely memory.
     */
    status = VT_ERROR_MEMORY;

  } while (0);

  VOLT_LOG_ERROR_COMPARE (
    status, theInt->mpCtx->voltObject.libraryCtx, status,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapSetBit", (char *)0)

  return (status);
}

int OpenSSLBnWrapGetBit (
   VoltMpInt *theInt,
   unsigned int bitIndex,
   unsigned int *value
   )
{
  int status;
  unsigned int bitLen;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  do
  {
    /* Check the arguments.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_NULL_ARG;
    if (value == (unsigned int *)0)
      break;
    status = 0;

    /* How big is the integer?
     */
    bitLen = (unsigned int)BN_num_bits ((BIGNUM *)(theInt->mpInt));
    if (bitLen == 0)
      bitLen = 1;

    /* If the index requested is beyond the end, set the value to 0.
     * We could return VT_ERROR_MP_INT_RANGE, but it is true that the
     * bit is 0. (Think of the decimal number 3,142, it is 03,142).
     */
    *value = 0;
    if (bitIndex >= bitLen)
      break;

    *value = (unsigned int)BN_is_bit_set (
      (BIGNUM *)(theInt->mpInt), (int)bitIndex);

  } while (0);

  VOLT_LOG_ERROR_COMPARE (
    status, theInt->mpCtx->voltObject.libraryCtx, status,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapGetBit", (char *)0)

  return (status);
}

int OpenSSLBnWrapShiftLeftBits (
   VoltMpInt *theInt,
   unsigned int shiftCount
   )
{
  int status;
  BIGNUM *temp = (BIGNUM *)0;
  BIGNUM *theBn, *retVal;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  theBn = (BIGNUM *)(theInt->mpInt);

  do
  {
    /* The OpenSSL shift function needs two bn's.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    temp = BN_new ();
    if (temp == (BIGNUM *)0)
      break;

    /* Copy the input and then shift the temp into the input arg.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    retVal = BN_copy (temp, theBn);
    if (retVal == (BIGNUM *)0)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_lshift (theBn, temp, (int)shiftCount) != 0)
      status = 0;

  } while (0);

  if (temp != (BIGNUM *)0)
    BN_free (temp);

  VOLT_LOG_ERROR_COMPARE (
    status, theInt->mpCtx->voltObject.libraryCtx, status,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapShiftLeftBits", (char *)0)

  return (status);
}

int OpenSSLBnWrapShiftRightBits (
   VoltMpInt *theInt,
   unsigned int shiftCount
   )
{
  int status;
  BIGNUM *temp = (BIGNUM *)0;
  BIGNUM *theBn, *retVal;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   */
  if (theInt == (VoltMpInt *)0)
    return (VT_ERROR_NULL_ARG);

  theBn = (BIGNUM *)(theInt->mpInt);

  do
  {
    /* The OpenSSL shift function needs two bn's.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    temp = BN_new ();
    if (temp == (BIGNUM *)0)
      break;

    /* Copy the input and then shift the temp into the input arg.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    retVal = BN_copy (temp, theBn);
    if (retVal == (BIGNUM *)0)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_rshift (theBn, temp, (int)shiftCount) != 0)
      status = 0;

  } while (0);

  if (temp != (BIGNUM *)0)
    BN_free (temp);

  VOLT_LOG_ERROR_COMPARE (
    status, theInt->mpCtx->voltObject.libraryCtx, status,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapShiftRightBits", (char *)0)

  return (status);
}

int OpenSSLBnWrapSubtract (
   VoltMpInt *minuend,
   VoltMpInt *subtrahend,
   VoltMpInt *difference
   )
{
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   * We could check for one NULL, the other not, but this is the kind
   * of error an app expects not to log.
   */
  if ( (minuend == (VoltMpInt *)0) ||
       (subtrahend == (VoltMpInt *)0) ||
       (difference == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  /* This function returns 1 for success, 0 for failure.
   * If there was an error, it was probably memory.
   */
  VOLT_SET_FNCT_LINE (fnctLine)
  if (BN_sub (
    (BIGNUM *)(difference->mpInt), (BIGNUM *)(minuend->mpInt),
    (BIGNUM *)(subtrahend->mpInt)) != 0)
    return (0);

  VOLT_LOG_ERROR (
    difference->mpCtx->voltObject.libraryCtx, VT_ERROR_MEMORY,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapSubtract", (char *)0)

  return (VT_ERROR_MEMORY);
}

int OpenSSLBnWrapAdd (
   VoltMpInt *addend1,
   VoltMpInt *addend2,
   VoltMpInt *sum
   )
{
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If NULL, we can't log an error, no libCtx.
   * We could check for one NULL, the other not, but this is the kind
   * of error an app expects not to log.
   */
  if ( (addend1 == (VoltMpInt *)0) ||
       (addend2 == (VoltMpInt *)0) ||
       (sum == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  /* This function returns 1 for success, 0 for failure.
   * If there was an error, it was probably memory.
   */
  VOLT_SET_FNCT_LINE (fnctLine)
  if (BN_add (
    (BIGNUM *)(sum->mpInt), (BIGNUM *)(addend1->mpInt),
    (BIGNUM *)(addend2->mpInt)) != 0)
    return (0);

  VOLT_LOG_ERROR (
    sum->mpCtx->voltObject.libraryCtx, VT_ERROR_MEMORY,
    VT_ERROR_TYPE_PRIMARY, fnctLine, "OpenSSLBnWrapAdd", (char *)0)

  return (VT_ERROR_MEMORY);
}

static int VoltGetBnCtxFromMpCtx(VoltMpIntCtx* mpCtx, BN_CTX** bnCtx)
{
  int status = 0;
  VtLibCtx libCtx;
  Pointer threadLocalKey;
  Pointer threadLocalData;
  VOLT_DECLARE_FNCT_LINE(fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)
  do
  {
    libCtx = mpCtx->voltObject.libraryCtx;

    threadLocalKey = mpCtx->localCtx;
    
    VOLT_SET_ERROR_TYPE(errorType, 0);
    VOLT_SET_FNCT_LINE (fnctLine)
    status = libCtx->threadCtx->GetThreadLocalData(libCtx->threadCtx,
      threadLocalKey, &threadLocalData);
    if (status != 0)
      break;
    
    if (threadLocalData == (Pointer)0)
    {
      VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY);
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_MEMORY;
      threadLocalData = (Pointer) BN_CTX_new();
      if (threadLocalData == (Pointer)0)
        break;
      
      VOLT_SET_ERROR_TYPE(errorType, 0);
      VOLT_SET_FNCT_LINE (fnctLine)
      status = libCtx->threadCtx->SetThreadLocalData(libCtx->threadCtx,
        threadLocalKey, threadLocalData);
      if (status != 0)
        break;
    }
    
    *bnCtx = (BN_CTX*)threadLocalData;
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, errorType, fnctLine,
    "GetBnCtxFromMpCtx", (char *)0)

  return status;
}

int OpenSSLBnWrapMultiply (
   VoltMpInt *multiplicand,
   VoltMpInt *multiplier,
   VoltMpInt *product
   )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区视频| 精品制服美女丁香| 一区二区三区欧美在线观看| 国产精品你懂的| 欧美国产1区2区| 国产精品理论在线观看| 最新日韩av在线| 亚洲一区二区三区在线播放| 午夜国产精品影院在线观看| 石原莉奈在线亚洲二区| 六月丁香婷婷色狠狠久久| 国产在线播放一区| 成人午夜免费av| 色综合久久88色综合天天6| 欧美色中文字幕| 欧美一级片免费看| 久久久久久久精| 国产精品成人网| 夜夜嗨av一区二区三区| 欧美视频一区在线观看| 欧美日本在线看| 日韩三级av在线播放| 久久日韩精品一区二区五区| 国产精品色婷婷久久58| 一区二区三区中文免费| 午夜久久福利影院| 国产精品中文字幕日韩精品| 99国产精品久久久久| 在线观看www91| 日韩亚洲欧美在线| 国产精品蜜臀av| 亚洲国产一区在线观看| 岛国精品一区二区| 色天天综合久久久久综合片| 国产精品系列在线播放| 色综合 综合色| 成人美女视频在线观看| 久久99久国产精品黄毛片色诱| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品久久久久一区二区三区 | 日韩电影网1区2区| 国产精品一区二区在线观看不卡| 91一区二区在线观看| 欧美一区二区三区在线看| 国产欧美一区二区三区鸳鸯浴 | 亚州成人在线电影| 国产福利一区在线观看| 欧美在线视频你懂得| 精品国产青草久久久久福利| 亚洲欧美日韩国产综合在线| 久久97超碰色| 91在线播放网址| 日韩精品一区二区三区三区免费| 一区二区中文视频| 美女网站一区二区| 一本久道久久综合中文字幕| 久久综合色一综合色88| 午夜伦欧美伦电影理论片| 成人爱爱电影网址| 欧美第一区第二区| 亚洲一二三四在线| 久久精品视频网| 天天做天天摸天天爽国产一区 | 久久久久久久久久久久电影| 亚洲成av人在线观看| 丁香另类激情小说| 欧美成人一区二区三区在线观看| 自拍偷拍国产精品| 国产成人精品影院| 精品国产乱码久久久久久图片 | 午夜激情久久久| 色综合天天综合网天天狠天天| 久久无码av三级| 奇米一区二区三区av| 欧美性受极品xxxx喷水| 欧美激情一区二区三区| 国模娜娜一区二区三区| 欧美一卡2卡三卡4卡5免费| 1024成人网| 成人av免费网站| 国产日韩欧美综合一区| 九九久久精品视频| 日韩欧美在线1卡| 视频一区欧美精品| 欧美日韩免费观看一区三区| 亚洲人成网站在线| 成人97人人超碰人人99| 久久精品水蜜桃av综合天堂| 国产一区二区在线影院| 精品毛片乱码1区2区3区| 人人精品人人爱| 在线91免费看| 五月综合激情日本mⅴ| 在线观看视频91| 亚洲精品视频免费看| 91视视频在线直接观看在线看网页在线看| 久久日韩粉嫩一区二区三区| 韩国欧美国产1区| 欧美精品一区二区三区在线| 久久99国产精品久久99果冻传媒| 日韩亚洲欧美一区二区三区| 免费在线观看精品| 精品久久久久一区| 精品亚洲国内自在自线福利| 2023国产一二三区日本精品2022| 国产毛片精品视频| 欧美激情一区不卡| 91在线观看高清| 亚洲影视在线播放| 欧美天堂亚洲电影院在线播放| 亚洲va中文字幕| 宅男在线国产精品| 开心九九激情九九欧美日韩精美视频电影| 日韩一二三区视频| 国产一区在线观看麻豆| 国产日韩成人精品| 91在线porny国产在线看| 亚洲一本大道在线| 日韩精品综合一本久道在线视频| 卡一卡二国产精品| 国产精品理论在线观看| 91久久香蕉国产日韩欧美9色| 欧美日韩久久不卡| 久久91精品久久久久久秒播| 欧美国产国产综合| 色妞www精品视频| 婷婷丁香久久五月婷婷| xfplay精品久久| 91色乱码一区二区三区| 亚洲bt欧美bt精品| 久久蜜桃av一区精品变态类天堂| av男人天堂一区| 亚洲韩国精品一区| 久久网站最新地址| 在线一区二区三区| 久久电影网站中文字幕| 中文字幕欧美激情一区| 欧美在线影院一区二区| 捆绑调教美女网站视频一区| 中文字幕免费不卡在线| 欧美亚洲国产一区在线观看网站 | 成人18视频日本| 亚洲成人你懂的| 久久久精品人体av艺术| 色屁屁一区二区| 国产永久精品大片wwwapp| 亚洲欧美日韩久久精品| 精品久久一二三区| 色噜噜夜夜夜综合网| 国产原创一区二区| 亚洲一区二区美女| 国产午夜精品美女毛片视频| 欧美最新大片在线看| 国产成人精品www牛牛影视| 亚洲国产精品人人做人人爽| 精品成人在线观看| 欧美亚洲综合色| 成熟亚洲日本毛茸茸凸凹| 视频一区二区国产| 亚洲摸摸操操av| 久久九九久精品国产免费直播| 欧美网站一区二区| 白白色 亚洲乱淫| 另类人妖一区二区av| 亚洲网友自拍偷拍| 中文字幕在线视频一区| 欧美不卡在线视频| 欧美性生活影院| 91首页免费视频| 国产精品小仙女| 九色porny丨国产精品| 亚瑟在线精品视频| 亚洲欧美日韩系列| 中文字幕不卡三区| 精品国产乱码久久久久久1区2区| 色丁香久综合在线久综合在线观看| 国产精品一区二区久久精品爱涩 | 欧美丝袜丝交足nylons| 成人av免费在线观看| 国产精品自在欧美一区| 美女尤物国产一区| 天堂蜜桃一区二区三区| 一区二区三区免费观看| 国产精品美女久久久久久久 | 亚洲黄色小视频| 国产精品电影一区二区| 国产视频不卡一区| 精品国产凹凸成av人网站| 欧美精品777| 欧美男女性生活在线直播观看| 色综合天天综合在线视频| 99视频国产精品| 成人av集中营| 丁香亚洲综合激情啪啪综合| 国产原创一区二区| 国产一区二区三区免费播放| 黄页视频在线91| 精品一区二区影视| 久久精品国产77777蜜臀| 蜜臀av一区二区三区|