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

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

?? opensslbnwrap.c

?? IBE是一種非對稱密碼技術
?? C
?? 第 1 頁 / 共 3 頁
字號:
{
  int status;
  VoltMpIntCtx *mpCtx;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)
  
  /* 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 ( (multiplicand == (VoltMpInt *)0) ||
       (multiplier == (VoltMpInt *)0) ||
       (product == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(multiplicand->mpCtx);
    
    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory.
     */
    VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_mul (
      (BIGNUM *)(product->mpInt), (BIGNUM *)(multiplicand->mpInt),
      (BIGNUM *)(multiplier->mpInt), bnCtx) == 0)
    {
      status = VT_ERROR_MEMORY;
      break;
    }
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE (
    status, product->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapMultiply", (char *)0)

  return (status);
}

int OpenSSLBnWrapSquare (
   VoltMpInt *operand,
   VoltMpInt *product
   )
{
  int status;
  VoltMpIntCtx *mpCtx;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (operand == (VoltMpInt *)0) ||
       (product == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(operand->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory.
     */
    VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_sqr (
      (BIGNUM *)(product->mpInt), (BIGNUM *)(operand->mpInt), bnCtx) == 0)
    {
      status = VT_ERROR_MEMORY;
      break;
    }
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE (
    status, product->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapSquare", (char *)0)

  return status;
}

int OpenSSLBnWrapDivide (
   VoltMpInt *dividend,
   VoltMpInt *divisor,
   VoltMpInt *quotient,
   VoltMpInt *remainder
   )
{
  int status;
  VoltMpIntCtx *mpCtx;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (dividend == (VoltMpInt *)0) ||
       (divisor == (VoltMpInt *)0) ||
       (quotient == (VoltMpInt *)0) ||
       (remainder == (VoltMpInt *)0) ) 
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(dividend->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* Can't divide by zero. If is_zero returns 1, then the value is zero.
     */
    VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_DIVIDE_BY_ZERO;
    if (BN_is_zero ((BIGNUM *)(divisor->mpInt)) == 1)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory (we already checked
     * for divide by 0).
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    if (BN_div (
      (BIGNUM *)(quotient->mpInt), (BIGNUM *)(remainder->mpInt),
      (BIGNUM *)(dividend->mpInt), (BIGNUM *)(divisor->mpInt), bnCtx) != 0)
      status = 0;

  } while (0);

  VOLT_LOG_ERROR_COMPARE (
    status, quotient->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapDivide", (char *)0)

  return (status);
}

int OpenSSLBnWrapGCD (
   VoltMpInt *operand1,
   VoltMpInt *operand2,
   VoltMpInt *result
   )
{
  int status;
  VoltMpIntCtx *mpCtx;
  BIGNUM *resultBn;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (operand1 == (VoltMpInt *)0) ||
         (operand2 == (VoltMpInt *)0) ||
         (result == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(operand1->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* Can't find GCD if one of the ops is zero. If is_zero returns 1,
     * then the value is zero.
     */
    VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_DIVIDE_BY_ZERO;
    if (BN_is_zero ((BIGNUM *)(operand1->mpInt)) == 1)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    if (BN_is_zero ((BIGNUM *)(operand2->mpInt)) == 1)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory (we already checked
     * for 0 operand).
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    resultBn = (BIGNUM *)(result->mpInt);
    if (BN_gcd (
      resultBn, (BIGNUM *)(operand1->mpInt), (BIGNUM *)(operand2->mpInt),
      bnCtx) == 0)
      break;

    status = 0;

  } while (0);

  VOLT_LOG_ERROR_COMPARE (
    status, result->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapGCD", (char *)0)

  return (status);
}

int OpenSSLBnWrapModReduce (
   VoltMpInt *operand,
   VoltMpInt *modulus,
   VoltMpInt *result
   )
{
  int status;
  VoltMpIntCtx *mpCtx;
  BIGNUM *resultBn;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (operand == (VoltMpInt *)0) ||
       (modulus == (VoltMpInt *)0) ||
       (result == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(operand->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* Can't divide by zero. If is_zero returns 1, then the value is zero.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_DIVIDE_BY_ZERO;
    if (BN_is_zero ((BIGNUM *)(modulus->mpInt)) == 1)
      break;

    /* This function returns 1 for success, 0 for failure.
     * If there was an error, it was probably memory (we already checked
     * for divide by 0).
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    resultBn = (BIGNUM *)(result->mpInt);
    if (BN_mod (
      resultBn, (BIGNUM *)(operand->mpInt), (BIGNUM *)(modulus->mpInt),
      bnCtx) != 0)
    {
      /* We need to account for negative operands.
       * 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 BN_add returns 0, error.
       */
      if (resultBn->neg != 0)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        if (BN_add (resultBn, resultBn, (BIGNUM *)(modulus->mpInt)) == 0)
          break;
      }

      status = 0;
    }
  } while (0);

  VOLT_LOG_ERROR_COMPARE (
    status, result->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapModReduce", (char *)0)

  return (status);
}

int OpenSSLBnWrapModInvert (
   VoltMpInt *operand,
   VoltMpInt *modulus,
   VoltMpInt *result
   )
{
  int status;
  unsigned long bnErr;
  VoltMpIntCtx *mpCtx;
  BIGNUM *retVal;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (operand == (VoltMpInt *)0) ||
       (modulus == (VoltMpInt *)0) ||
       (result == (VoltMpInt *)0) )
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(operand->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    retVal = BN_mod_inverse (
      (BIGNUM *)(result->mpInt), (BIGNUM *)(operand->mpInt),
      (BIGNUM *)(modulus->mpInt), bnCtx);

    /* The return value is NULL for error. If not NULL, no error.
     */
    if (retVal != (BIGNUM *)0)
      return (0);

    /* If there was an error, what was it? If not MEMORY, then there must
     * be no inverse.
     */
    bnErr = ERR_get_error ();

    status = VT_ERROR_MEMORY;
    if (bnErr != ERR_R_MALLOC_FAILURE)
      status = VT_ERROR_NO_INVERSE;
  }
  while (0);
  
  VOLT_LOG_ERROR (
    result->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapModInvert", (char *)0)

  return (status);
}

int OpenSSLBnWrapModExp (
   VoltMpInt *base,
   VoltMpInt *exponent,
   VoltMpInt *modulus,
   VoltMpInt *result
   )
{
  int status;
  unsigned long bnErr;
  VoltMpIntCtx *mpCtx;
  BN_CTX *bnCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  /* 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 ( (base == (VoltMpInt *)0) ||
       (exponent == (VoltMpInt *)0) ||
       (modulus == (VoltMpInt *)0) ||
       (result == (VoltMpInt *)0) ) 
    return (VT_ERROR_NULL_ARG);

  do
  {
    mpCtx = (VoltMpIntCtx *)(base->mpCtx);

    /* Get the bnCtx from the mpCtx. This will be stored
     * in thread-local data for multi-thread thread context
     */
    VOLT_SET_ERROR_TYPE(errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetBnCtxFromMpCtx(mpCtx, &bnCtx);
    if (status != 0)
      break;

    /* This function returns 1 for success, 0 for failure.
     */
    if (BN_mod_exp (
      (BIGNUM *)(result->mpInt), (BIGNUM *)(base->mpInt),
      (BIGNUM *)(exponent->mpInt), (BIGNUM *)(modulus->mpInt), bnCtx) != 0)
      return (0);

    /* If there was an error, what was it?
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MP_PROVIDER;
    bnErr = ERR_get_error ();
    if (bnErr == ERR_R_MALLOC_FAILURE)
      status = VT_ERROR_MEMORY;
  }
  while (0);
  
  VOLT_LOG_ERROR (
    result->mpCtx->voltObject.libraryCtx, status,
    errorType, fnctLine, "OpenSSLBnWrapModExp", (char *)0)

  return (status);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一卡在线观看| 国产成人a级片| 欧美性大战久久久久久久蜜臀| 中文字幕一区二区三区在线观看| 国产在线日韩欧美| 久久久国产一区二区三区四区小说| 国产精品综合一区二区| 国产精品乱码人人做人人爱| www.日韩精品| 亚洲一区国产视频| 欧美一级精品在线| 国产成人免费在线视频| 亚洲视频一区在线| 欧美日韩成人综合天天影院 | 美女精品自拍一二三四| 日韩精品一区二区三区在线| 国产剧情一区在线| 一二三四社区欧美黄| 日韩欧美中文字幕公布| 成人精品视频一区| 亚洲大片免费看| 26uuu欧美| 欧美色老头old∨ideo| 国内精品国产成人国产三级粉色| 日韩美女视频19| 日韩午夜电影av| www.成人网.com| 日韩成人一区二区| 亚洲四区在线观看| 26uuu国产在线精品一区二区| 99久久国产免费看| 国内外精品视频| 亚洲一区二区三区视频在线 | 欧美成人aa大片| 99久久夜色精品国产网站| 亚洲国产一区二区三区青草影视 | 国产91露脸合集magnet| 亚洲一级二级三级在线免费观看| 精品少妇一区二区三区免费观看 | 精品成人在线观看| 欧美午夜精品久久久久久孕妇| 国产自产v一区二区三区c| 一区二区三区在线视频观看 | 国产精品网曝门| 91精品在线观看入口| 99麻豆久久久国产精品免费| 麻豆中文一区二区| 亚洲图片一区二区| 中文字幕一区av| 久久免费国产精品| 日韩一二三区不卡| 欧美午夜精品一区二区三区| 不卡的电视剧免费网站有什么| 另类综合日韩欧美亚洲| 亚洲愉拍自拍另类高清精品| 国产精品女主播av| 国产亚洲欧美日韩俺去了| 日韩一区二区三区四区五区六区| 欧美性受xxxx| 欧美午夜一区二区| 欧美在线一二三四区| av资源站一区| va亚洲va日韩不卡在线观看| 精品中文av资源站在线观看| 天堂成人免费av电影一区| 一区二区三区四区高清精品免费观看 | 国产午夜久久久久| 欧美xxxx在线观看| 日韩一卡二卡三卡| 日韩精品最新网址| 日韩一区二区电影| 精品三级av在线| 亚洲精品在线观看视频| 精品国产免费一区二区三区四区| 91精品在线免费| 日韩亚洲欧美一区| 欧美一区二区三区播放老司机| 欧美群妇大交群的观看方式| 欧美视频自拍偷拍| 91精品国产入口在线| 91麻豆精品91久久久久久清纯| 欧美一区二区三区免费| 欧美成人vps| 欧美激情一区二区三区不卡| 国产色产综合色产在线视频| 国产亚洲一区字幕| 中文字幕一区二区三区精华液| 亚洲免费看黄网站| 亚洲高清免费视频| 久久不见久久见免费视频7| 精品一区二区国语对白| 国产成人免费视频一区| av在线播放成人| 91福利区一区二区三区| 欧美日韩国产综合草草| 日韩三级高清在线| 久久久久久久久久久久电影| 中文字幕一区二区在线观看| 亚洲成人免费视频| 久久国产精品99久久久久久老狼 | 99久久久免费精品国产一区二区 | 丝袜美腿一区二区三区| 六月丁香婷婷久久| 成人爱爱电影网址| 欧美日韩精品免费| 2欧美一区二区三区在线观看视频| 国产无一区二区| 一区二区三区欧美| 久久电影国产免费久久电影 | 91精彩视频在线| 这里只有精品免费| 国产欧美精品在线观看| 一区二区国产盗摄色噜噜| 美女爽到高潮91| 99久久精品久久久久久清纯| 欧美绝品在线观看成人午夜影视| www国产精品av| 亚洲自拍偷拍图区| 国产一区二区三区免费在线观看 | 婷婷中文字幕综合| 国产69精品久久99不卡| 欧美丝袜自拍制服另类| 国产日韩精品一区二区浪潮av| 性久久久久久久| 国产成都精品91一区二区三 | 精品国产免费人成电影在线观看四季 | 91香蕉视频污在线| 精品久久国产老人久久综合| 日韩理论片中文av| 国产精品自在在线| 欧美喷潮久久久xxxxx| 欧美国产1区2区| 麻豆精品新av中文字幕| 91九色02白丝porn| 国产亚洲欧美激情| 午夜精品久久久久久久| 国产电影精品久久禁18| 欧美人与z0zoxxxx视频| 亚洲精品视频在线观看网站| 狠狠色狠狠色综合系列| 欧美久久久久中文字幕| 中文字幕一区二区5566日韩| 国产在线视视频有精品| 欧美日韩高清影院| 亚洲自拍偷拍网站| 91丨九色丨蝌蚪丨老版| 久久久精品综合| 精品亚洲免费视频| 日韩亚洲电影在线| 婷婷激情综合网| 欧美性大战久久久久久久蜜臀| 亚洲视频一区二区在线观看| 成人精品国产免费网站| 中文字幕欧美三区| 日本不卡中文字幕| 91精品一区二区三区久久久久久| 亚洲成人av福利| 欧美特级限制片免费在线观看| 国产精品久久久久久妇女6080| 国产一区二区在线观看视频| 日韩欧美国产成人一区二区| 日韩精品成人一区二区在线| 欧美日韩一区二区欧美激情| 亚洲综合一二区| 色诱亚洲精品久久久久久| 亚洲丝袜另类动漫二区| 色综合婷婷久久| 亚洲免费观看高清完整版在线观看 | 日本不卡视频在线观看| 欧美二区乱c少妇| 日韩国产欧美三级| 欧美一级艳片视频免费观看| 日本午夜精品视频在线观看| 日韩欧美国产wwwww| 国产精品一区二区免费不卡| 久久久精品免费网站| 丁香亚洲综合激情啪啪综合| 中文成人av在线| 色综合天天做天天爱| 亚洲成人免费看| 欧美一区二区三区公司| 国产一区在线看| 国产精品免费久久久久| 91在线观看成人| 亚洲午夜久久久久久久久电影网| 精品视频资源站| 免费高清在线视频一区·| 精品久久久久久久久久久久久久久久久 | 在线亚洲+欧美+日本专区| 调教+趴+乳夹+国产+精品| 日韩一区二区精品| 成人永久免费视频| 一区二区三区在线观看动漫| 4438x亚洲最大成人网| 国产激情一区二区三区| 国产精品动漫网站| 欧美精品xxxxbbbb| 国产成人免费视频精品含羞草妖精 | 91福利精品第一导航| 免费观看成人鲁鲁鲁鲁鲁视频|