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

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

?? lucas.c

?? IBE是一種非對稱密碼技術
?? C
?? 第 1 頁 / 共 2 頁
字號:
      status = mpCtx->ModReduce (newU, primeCandidate, newV);
      if (status != 0)
        break;

      /* Now compute (U + V) / 2 mod N
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->Add (VVal, UVal, newU);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->GetBit (newU, 0, &getBit);
      if (status != 0)
        break;

      if (getBit == 1)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->Add (primeCandidate, newU, newU);
        if (status != 0)
          break;
      }

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->ShiftRightBits (newU, 1);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->ModReduce (newU, primeCandidate, UVal);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->MpIntToMpInt (newV, VVal);
      if (status != 0)
        break;
    }

    /* When we've gone through all the bits of N + 1, if U is 0, the
     * candidate passes the test.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = mpCtx->EvenOddZeroPositiveNegative (UVal, &getZero);
    if (status != 0)
      break;

    if (getZero == 0)
      *isPrime = 1;

  } while (0);

  mpCtx->DestroyMpInt (&newU);
  mpCtx->DestroyMpInt (&newV);
  mpCtx->DestroyMpInt (&UVal);
  mpCtx->DestroyMpInt (&VVal);
  mpCtx->DestroyMpInt (&NPlus1);
  mpCtx->DestroyMpInt (&DValue);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, 0, mpCtx, status, 0, errorType,
    (char *)0, "VoltLucasTest", fnctLine, (char *)0)

  return (status);
}

#define FIND_DVALUE_LIMIT 256

static int FindLucasDValue (
   VoltMpInt *primeCandidate,
   VoltMpInt *DValue,
   VoltMpInt *temp1,
   VoltMpInt *temp2,
   unsigned int *valueFound
   )
{
  int status, currentD, currentSign, jacobi;
  unsigned int index, limit;
  VoltMpIntCtx *mpCtx = (VoltMpIntCtx *)(primeCandidate->mpCtx);
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  *valueFound = 0;

  do
  {
    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)

    /* Try the D possibilities. Keep trying until we run out of
     * possibilities.
     * Start with 5 and a positive sign, then increment by 2 and
     * alternate between positive and negative.
     */
    limit = FIND_DVALUE_LIMIT;
    currentSign = 0;
    currentD = 5;
    for (index = 0; index < limit; ++index)
    {
      /* If 0, the sign is positive, DValue is the currentD.
       */
      if (currentSign == 0)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->IntToMpInt (0, currentD, DValue);
        if (status != 0)
          break;
      }
      else
      {
        /* If currentSign is not 0, the d possibility is negative, we
         * want p - d.
         */
        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->IntToMpInt (0, currentD, temp2);
        if (status != 0)
          break;

        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->Subtract (primeCandidate, temp2, DValue);
        if (status != 0)
          break;
      }

      /* Find the Jacobi of this D candidate.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = FindJacobi (DValue, primeCandidate, temp1, temp2, &jacobi);
      if (status != 0)
        break;

      /* If the Jacobi is -1, we have our D.
       */
      if (jacobi == -1)
        break;

      /* The new sign. If it is currently 0, it will become 1, if it is
       * 1, it will become 0.
       */
      currentSign ^= 1;
      currentD += 2;
    }
    if (status != 0)
      break;

    /* If we went through the list and found no D, return, status is 0
     * and valueFound is 0. If we didn't go through the list, we found
     * our D, change valueFound to 1.
     */
    if (index < limit)
      *valueFound = 1;

  } while (0);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, 0, mpCtx, status, 0, errorType,
    (char *)0, "FindLucasDValue", fnctLine, (char *)0)

  return (status);
}

static int FindJacobi (
   VoltMpInt *aVal,
   VoltMpInt *nVal,
   VoltMpInt *temp1,
   VoltMpInt *temp2,
   int *jacobi
   )
{
  int status, aStatus, jReturn;
  unsigned int bit1, bit2;
  VoltMpIntCtx *mpCtx = (VoltMpIntCtx *)(nVal->mpCtx);
  VoltMpInt *swap, *a, *n;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  jReturn = 1;

  do
  {
    /* Set a to the incoming aVal and n to the incoming nVal.
     */
    a = temp1;
    n = temp2;

    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = mpCtx->MpIntToMpInt (aVal, a);
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = mpCtx->MpIntToMpInt (nVal, n);
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = mpCtx->EvenOddZeroPositiveNegative (a, &aStatus);
    if (status != 0)
      break;

    /* While a != 0, keep looping.
     */
    while (aStatus != 0)
    {
      /* We're going to need to know either or both of n mod 8 and
       * n mod 4. We know that n is odd, so bit 0 is 1. Get bits 1 and
       * 2.
       * If bits 1 and 2 are 1, then n mod 8 is 7
       * If bits 1 and 2 are 0, then n mod 8 is 1
       * If bit 1 is 1 and bit 2 is 0, then n mod 8 is 3
       * If bit 1 is 0 and bit 2 is 1, then n mod 8 is 5
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->GetBit (n, 1, &bit1);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->GetBit (n, 2, &bit2);
      if (status != 0)
        break;

      /* If a is even, divide by two and do some extra work until it is
       * odd.
       */
      while ((aStatus & 1) == 0)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->ShiftRightBits (a, 1);
        if (status != 0)
          break;

        /* If n mod 8 is 3 or 5, j = -j.
         */
        if (bit1 != bit2)
          jReturn = -jReturn;

        VOLT_SET_FNCT_LINE (fnctLine)
        status = mpCtx->EvenOddZeroPositiveNegative (a, &aStatus);
        if (status != 0)
          break;
      }

      /* Swap a and n.
       */
      swap = a;
      a = n;
      n = swap;

      /* If a mod 4 is 3 and n mod 4 is 3, then j = -j.
       * We know both n and a are odd, we have bit1 of a (it was n), so
       * get bit1 of n.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->GetBit (n, 1, &bit2);
      if (status != 0)
        break;

      /* If both the bits we got are 1, both numbers are 3 mod 4.
       */
      if ( (bit1 == 1) && (bit2 == 1) )
        jReturn = -jReturn;

      /* a = a mod n.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->ModReduce (a, n, a);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = mpCtx->EvenOddZeroPositiveNegative (a, &aStatus);
      if (status != 0)
        break;
    }

    /* When a == 0, we're done. Just one more check. If n == 1, then
     * return j. If not, return 0.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = mpCtx->MpIntToInt (n, 0, &aStatus);
    if (status != 0)
    {
      if (status != VT_ERROR_MP_INT_RANGE)
        break;

      /* If the error was RANGE, then n is not 1.
       */
      aStatus = 2;
      status = 0;
    }

    if (aStatus != 1)
      jReturn = 0;

  } while (0);

  *jacobi = jReturn;

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, 0, mpCtx, status, 0, errorType,
    (char *)0, "FindJacobi", fnctLine, (char *)0)

  return (status);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日本亚洲高清| 在线不卡免费欧美| 欧美在线观看视频一区二区三区| 欧美日韩中文字幕一区二区| 日韩一级二级三级精品视频| 中文字幕一区在线| 国产在线日韩欧美| 欧美日韩1区2区| 亚洲欧美色图小说| 福利一区二区在线| 欧美va日韩va| 蜜桃一区二区三区在线| 欧美性受xxxx黑人xyx| 国产精品午夜在线| 黄色日韩网站视频| 日韩美女视频在线| 日本亚洲电影天堂| 色视频成人在线观看免| 国产精品伦一区| 国产精品影视在线观看| 欧美精品vⅰdeose4hd| 亚洲欧美色一区| 99r精品视频| 国产精品福利一区二区| 国产一区二区三区| 久久综合精品国产一区二区三区| 午夜精品久久一牛影视| 欧美在线免费视屏| 亚洲亚洲精品在线观看| 91视频免费观看| 亚洲女女做受ⅹxx高潮| 99精品国产一区二区三区不卡| 久久蜜桃av一区二区天堂| 久久精品国产秦先生| 91精品一区二区三区久久久久久 | 成人av网址在线观看| 日韩女同互慰一区二区| 美腿丝袜亚洲综合| 欧美电影免费观看高清完整版在线 | 国产成人免费视频网站| 精品人伦一区二区色婷婷| 免费成人你懂的| 欧美成人精品福利| 国产一区福利在线| 国产精品私房写真福利视频| 成人国产电影网| 亚洲精品日日夜夜| 欧美精品一级二级| 蜜臀av一区二区在线免费观看| 日韩视频免费直播| 国产精品一二三区在线| 国产精品嫩草久久久久| 一本久道中文字幕精品亚洲嫩| 伊人一区二区三区| 91精品国产色综合久久| 国产一区二区三区国产| 综合久久一区二区三区| 欧美三级中文字幕| 国内一区二区在线| 亚洲精品伦理在线| 日韩视频123| 成人免费毛片aaaaa**| 亚洲综合久久av| 日韩午夜在线影院| 成+人+亚洲+综合天堂| 一区二区欧美精品| 精品不卡在线视频| 日本国产一区二区| 激情六月婷婷综合| 亚洲色欲色欲www| 91精品国产91热久久久做人人| 韩国成人在线视频| 亚洲精选视频在线| 精品第一国产综合精品aⅴ| caoporn国产精品| 日本最新不卡在线| 国产精品初高中害羞小美女文| 欧美巨大另类极品videosbest | 91精品福利在线一区二区三区 | 久久超级碰视频| 中文字幕在线视频一区| 91精品婷婷国产综合久久性色| 国产成人精品亚洲日本在线桃色 | 精品影院一区二区久久久| 国产精品九色蝌蚪自拍| 欧美不卡在线视频| 欧美日韩视频在线第一区 | 免费高清视频精品| 一区二区高清免费观看影视大全| 精品粉嫩aⅴ一区二区三区四区| 欧美调教femdomvk| 成人动漫一区二区在线| 激情国产一区二区| 日韩精品成人一区二区三区| 国产精品久久午夜夜伦鲁鲁| 久久影院午夜片一区| 欧美精品久久久久久久多人混战| 99久久久久久| 国产二区国产一区在线观看| 亚洲va天堂va国产va久| 综合色中文字幕| 国产精品久久久久久久裸模| 精品国产伦一区二区三区观看方式| 欧美私模裸体表演在线观看| 99久久精品免费| 成人中文字幕合集| 成人在线综合网| 国产福利精品一区| 国产**成人网毛片九色| 国产河南妇女毛片精品久久久| 麻豆高清免费国产一区| 日本成人中文字幕在线视频| 亚洲国产aⅴ成人精品无吗| 有坂深雪av一区二区精品| 亚洲蜜臀av乱码久久精品 | www.色综合.com| 不卡在线视频中文字幕| 成人黄色在线网站| 成人app软件下载大全免费| 成人性生交大合| 99久久久国产精品免费蜜臀| 91免费国产在线观看| jlzzjlzz欧美大全| 99精品国产一区二区三区不卡| 91色在线porny| 欧美性受xxxx| 4438成人网| 久久免费国产精品| 国产精品女人毛片| 一区二区三区在线看| 亚洲一区二三区| 美女视频一区二区| 国产一区二区三区高清播放| 成人精品视频一区| 色婷婷av一区二区三区大白胸| 91福利在线播放| 91精品婷婷国产综合久久竹菊| 日韩精品一区二区三区视频| 国产亚洲精品7777| 亚洲精品国产精品乱码不99| 亚洲一区欧美一区| 久88久久88久久久| av在线这里只有精品| 欧美特级限制片免费在线观看| 日韩一级完整毛片| 国产精品久久久久婷婷二区次| 亚洲黄色小视频| 久久国产视频网| 一本久久精品一区二区| 日韩欧美另类在线| 18欧美乱大交hd1984| 天天色综合成人网| 国产成人日日夜夜| 欧美三级视频在线观看| 久久久亚洲精华液精华液精华液| 亚洲色图一区二区三区| 免费一区二区视频| 91原创在线视频| 精品国产乱码久久久久久夜甘婷婷| 国产精品久久久久久久久快鸭 | 国产综合久久久久久鬼色| av在线综合网| 日韩欧美国产综合| 亚洲乱码国产乱码精品精可以看| 日韩精品免费专区| 色88888久久久久久影院按摩| 精品福利在线导航| 丝袜诱惑亚洲看片| 97se亚洲国产综合自在线不卡| 日韩欧美一区二区在线视频| 亚洲欧美怡红院| 国产一区二区三区视频在线播放| 91国内精品野花午夜精品| 欧美极品少妇xxxxⅹ高跟鞋| 青青草国产精品97视觉盛宴 | 亚洲视频在线观看三级| 精品制服美女久久| 6080国产精品一区二区| 亚洲免费观看在线观看| 成人高清视频免费观看| 久久久精品天堂| 另类综合日韩欧美亚洲| 欧美日韩一卡二卡三卡 | 91麻豆免费看片| 欧美精彩视频一区二区三区| 久久av老司机精品网站导航| 欧美日韩国产一级二级| 亚洲综合在线免费观看| av中文字幕一区| 亚洲欧洲av在线| jlzzjlzz亚洲日本少妇| 国产精品久久久久久亚洲伦| 国产69精品久久99不卡| 久久久久国产免费免费| 国精产品一区一区三区mba桃花| 欧美一区二区在线播放| 日韩精品午夜视频| 欧美一区在线视频| 激情五月激情综合网| 26uuu久久综合|