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

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

?? mpi.c

?? tommath庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* Start: bn_error.c */#include <tommath.h>#ifdef BN_ERROR_C/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org */static const struct {     int code;     char *msg;} msgs[] = {     { MP_OKAY, "Successful" },     { MP_MEM,  "Out of heap" },     { MP_VAL,  "Value out of range" }};/* return a char * string for a given code */char *mp_error_to_string(int code){   int x;   /* scan the lookup table for the given message */   for (x = 0; x < (int)(sizeof(msgs) / sizeof(msgs[0])); x++) {       if (msgs[x].code == code) {          return msgs[x].msg;       }   }   /* generic reply for invalid code */   return "Invalid error code";}#endif/* End: bn_error.c *//* Start: bn_fast_mp_invmod.c */#include <tommath.h>#ifdef BN_FAST_MP_INVMOD_C/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org *//* computes the modular inverse via binary extended euclidean algorithm,  * that is c = 1/a mod b  * * Based on slow invmod except this is optimized for the case where b is  * odd as per HAC Note 14.64 on pp. 610 */intfast_mp_invmod (mp_int * a, mp_int * b, mp_int * c){  mp_int  x, y, u, v, B, D;  int     res, neg;  /* 2. [modified] b must be odd   */  if (mp_iseven (b) == 1) {    return MP_VAL;  }  /* init all our temps */  if ((res = mp_init_multi(&x, &y, &u, &v, &B, &D, NULL)) != MP_OKAY) {     return res;  }  /* x == modulus, y == value to invert */  if ((res = mp_copy (b, &x)) != MP_OKAY) {    goto LBL_ERR;  }  /* we need y = |a| */  if ((res = mp_abs (a, &y)) != MP_OKAY) {    goto LBL_ERR;  }  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */  if ((res = mp_copy (&x, &u)) != MP_OKAY) {    goto LBL_ERR;  }  if ((res = mp_copy (&y, &v)) != MP_OKAY) {    goto LBL_ERR;  }  mp_set (&D, 1);top:  /* 4.  while u is even do */  while (mp_iseven (&u) == 1) {    /* 4.1 u = u/2 */    if ((res = mp_div_2 (&u, &u)) != MP_OKAY) {      goto LBL_ERR;    }    /* 4.2 if B is odd then */    if (mp_isodd (&B) == 1) {      if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) {        goto LBL_ERR;      }    }    /* B = B/2 */    if ((res = mp_div_2 (&B, &B)) != MP_OKAY) {      goto LBL_ERR;    }  }  /* 5.  while v is even do */  while (mp_iseven (&v) == 1) {    /* 5.1 v = v/2 */    if ((res = mp_div_2 (&v, &v)) != MP_OKAY) {      goto LBL_ERR;    }    /* 5.2 if D is odd then */    if (mp_isodd (&D) == 1) {      /* D = (D-x)/2 */      if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) {        goto LBL_ERR;      }    }    /* D = D/2 */    if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {      goto LBL_ERR;    }  }  /* 6.  if u >= v then */  if (mp_cmp (&u, &v) != MP_LT) {    /* u = u - v, B = B - D */    if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) {      goto LBL_ERR;    }    if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) {      goto LBL_ERR;    }  } else {    /* v - v - u, D = D - B */    if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) {      goto LBL_ERR;    }    if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) {      goto LBL_ERR;    }  }  /* if not zero goto step 4 */  if (mp_iszero (&u) == 0) {    goto top;  }  /* now a = C, b = D, gcd == g*v */  /* if v != 1 then there is no inverse */  if (mp_cmp_d (&v, 1) != MP_EQ) {    res = MP_VAL;    goto LBL_ERR;  }  /* b is now the inverse */  neg = a->sign;  while (D.sign == MP_NEG) {    if ((res = mp_add (&D, b, &D)) != MP_OKAY) {      goto LBL_ERR;    }  }  mp_exch (&D, c);  c->sign = neg;  res = MP_OKAY;LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL);  return res;}#endif/* End: bn_fast_mp_invmod.c *//* Start: bn_fast_mp_montgomery_reduce.c */#include <tommath.h>#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org *//* computes xR**-1 == x (mod N) via Montgomery Reduction * * This is an optimized implementation of montgomery_reduce * which uses the comba method to quickly calculate the columns of the * reduction. * * Based on Algorithm 14.32 on pp.601 of HAC.*/intfast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho){  int     ix, res, olduse;  mp_word W[MP_WARRAY];  /* get old used count */  olduse = x->used;  /* grow a as required */  if (x->alloc < n->used + 1) {    if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) {      return res;    }  }  /* first we have to get the digits of the input into   * an array of double precision words W[...]   */  {    register mp_word *_W;    register mp_digit *tmpx;    /* alias for the W[] array */    _W   = W;    /* alias for the digits of  x*/    tmpx = x->dp;    /* copy the digits of a into W[0..a->used-1] */    for (ix = 0; ix < x->used; ix++) {      *_W++ = *tmpx++;    }    /* zero the high words of W[a->used..m->used*2] */    for (; ix < n->used * 2 + 1; ix++) {      *_W++ = 0;    }  }  /* now we proceed to zero successive digits   * from the least significant upwards   */  for (ix = 0; ix < n->used; ix++) {    /* mu = ai * m' mod b     *     * We avoid a double precision multiplication (which isn't required)     * by casting the value down to a mp_digit.  Note this requires     * that W[ix-1] have  the carry cleared (see after the inner loop)     */    register mp_digit mu;    mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK);    /* a = a + mu * m * b**i     *     * This is computed in place and on the fly.  The multiplication     * by b**i is handled by offseting which columns the results     * are added to.     *     * Note the comba method normally doesn't handle carries in the     * inner loop In this case we fix the carry from the previous     * column since the Montgomery reduction requires digits of the     * result (so far) [see above] to work.  This is     * handled by fixing up one carry after the inner loop.  The     * carry fixups are done in order so after these loops the     * first m->used words of W[] have the carries fixed     */    {      register int iy;      register mp_digit *tmpn;      register mp_word *_W;      /* alias for the digits of the modulus */      tmpn = n->dp;      /* Alias for the columns set by an offset of ix */      _W = W + ix;      /* inner loop */      for (iy = 0; iy < n->used; iy++) {          *_W++ += ((mp_word)mu) * ((mp_word)*tmpn++);      }    }    /* now fix carry for next digit, W[ix+1] */    W[ix + 1] += W[ix] >> ((mp_word) DIGIT_BIT);  }  /* now we have to propagate the carries and   * shift the words downward [all those least   * significant digits we zeroed].   */  {    register mp_digit *tmpx;    register mp_word *_W, *_W1;    /* nox fix rest of carries */    /* alias for current word */    _W1 = W + ix;    /* alias for next word, where the carry goes */    _W = W + ++ix;    for (; ix <= n->used * 2 + 1; ix++) {      *_W++ += *_W1++ >> ((mp_word) DIGIT_BIT);    }    /* copy out, A = A/b**n     *     * The result is A/b**n but instead of converting from an     * array of mp_word to mp_digit than calling mp_rshd     * we just copy them in the right order     */    /* alias for destination word */    tmpx = x->dp;    /* alias for shifted double precision result */    _W = W + n->used;    for (ix = 0; ix < n->used + 1; ix++) {      *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK));    }    /* zero oldused digits, if the input a was larger than     * m->used+1 we'll have to clear the digits     */    for (; ix < olduse; ix++) {      *tmpx++ = 0;    }  }  /* set the max used and clamp */  x->used = n->used + 1;  mp_clamp (x);  /* if A >= m then A = A - m */  if (mp_cmp_mag (x, n) != MP_LT) {    return s_mp_sub (x, n, x);  }  return MP_OKAY;}#endif/* End: bn_fast_mp_montgomery_reduce.c *//* Start: bn_fast_s_mp_mul_digs.c */#include <tommath.h>#ifdef BN_FAST_S_MP_MUL_DIGS_C/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org *//* Fast (comba) multiplier * * This is the fast column-array [comba] multiplier.  It is  * designed to compute the columns of the product first  * then handle the carries afterwards.  This has the effect  * of making the nested loops that compute the columns very * simple and schedulable on super-scalar processors. * * This has been modified to produce a variable number of  * digits of output so if say only a half-product is required  * you don't have to compute the upper half (a feature  * required for fast Barrett reduction). * * Based on Algorithm 14.12 on pp.595 of HAC. * */intfast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs){  int     olduse, res, pa, ix, iz;  mp_digit W[MP_WARRAY];  register mp_word  _W;  /* grow the destination as required */  if (c->alloc < digs) {    if ((res = mp_grow (c, digs)) != MP_OKAY) {      return res;    }  }  /* number of output digits to produce */  pa = MIN(digs, a->used + b->used);  /* clear the carry */  _W = 0;  for (ix = 0; ix < pa; ix++) {       int      tx, ty;      int      iy;      mp_digit *tmpx, *tmpy;      /* get offsets into the two bignums */      ty = MIN(b->used-1, ix);      tx = ix - ty;      /* setup temp aliases */      tmpx = a->dp + tx;      tmpy = b->dp + ty;      /* this is the number of times the loop will iterrate, essentially its          while (tx++ < a->used && ty-- >= 0) { ... }       */      iy = MIN(a->used-tx, ty+1);      /* execute loop */      for (iz = 0; iz < iy; ++iz) {         _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);      }      /* store term */      W[ix] = ((mp_digit)_W) & MP_MASK;      /* make next carry */      _W = _W >> ((mp_word)DIGIT_BIT);  }  /* store final carry */  W[ix] = _W;  /* setup dest */  olduse  = c->used;  c->used = digs;  {    register mp_digit *tmpc;    tmpc = c->dp;    for (ix = 0; ix < digs; ix++) {      /* now extract the previous digit [below the carry] */      *tmpc++ = W[ix];    }    /* clear unused digits [that existed in the old copy of c] */    for (; ix < olduse; ix++) {      *tmpc++ = 0;    }  }  mp_clamp (c);  return MP_OKAY;}#endif/* End: bn_fast_s_mp_mul_digs.c *//* Start: bn_fast_s_mp_mul_high_digs.c */#include <tommath.h>#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org *//* this is a modified version of fast_s_mul_digs that only produces * output digits *above* digs.  See the comments for fast_s_mul_digs * to see how it works. * * This is used in the Barrett reduction since for one of the multiplications * only the higher digits were needed.  This essentially halves the work. * * Based on Algorithm 14.12 on pp.595 of HAC. */intfast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs){  int     olduse, res, pa, ix, iz;  mp_digit W[MP_WARRAY];  mp_word  _W;  /* grow the destination as required */  pa = a->used + b->used;  if (c->alloc < pa) {    if ((res = mp_grow (c, pa)) != MP_OKAY) {      return res;    }  }  /* number of output digits to produce */  pa = a->used + b->used;  _W = 0;  for (ix = digs; ix < pa; ix++) {       int      tx, ty, iy;      mp_digit *tmpx, *tmpy;      /* get offsets into the two bignums */      ty = MIN(b->used-1, ix);      tx = ix - ty;      /* setup temp aliases */      tmpx = a->dp + tx;      tmpy = b->dp + ty;      /* this is the number of times the loop will iterrate, essentially its          while (tx++ < a->used && ty-- >= 0) { ... }       */      iy = MIN(a->used-tx, ty+1);      /* execute loop */      for (iz = 0; iz < iy; iz++) {         _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);      }      /* store term */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区在线免费观看| 国产精品成人免费| 国产成人在线影院 | 国产激情视频一区二区三区欧美| 国产日本欧美一区二区| 色婷婷亚洲综合| 美女网站在线免费欧美精品| 中文字幕一区二区三中文字幕| 欧美精品久久99久久在免费线| 九九九精品视频| 亚洲午夜三级在线| 2020国产精品| 欧美日韩高清一区二区| 成人激情免费电影网址| 午夜精品久久久久久久99樱桃| 欧美成人女星排名| 欧美日韩一区二区欧美激情| 国产成人啪午夜精品网站男同| 亚洲福利国产精品| √…a在线天堂一区| 久久精品一区蜜桃臀影院| 欧美一级午夜免费电影| 色婷婷综合久久久中文一区二区 | 中国av一区二区三区| 欧美成人一区二区| 8v天堂国产在线一区二区| 91国偷自产一区二区开放时间 | 欧美国产日韩一二三区| 久久久久国产精品厨房| 欧美一区二区三级| 在线不卡欧美精品一区二区三区| 91小视频在线免费看| 成人综合在线观看| 国产.欧美.日韩| 精品亚洲成a人在线观看| 日日夜夜精品免费视频| 日韩经典一区二区| 五月天亚洲婷婷| 亚洲亚洲人成综合网络| 亚洲图片有声小说| 亚洲国产精品欧美一二99| 亚洲色图制服诱惑| 亚洲美女免费在线| 亚洲午夜激情av| 日韩avvvv在线播放| 日本va欧美va瓶| 狠狠色狠狠色综合日日91app| 国产一区在线精品| 成a人片国产精品| 色综合天天在线| 欧美体内she精视频| 日韩欧美一区二区三区在线| 精品久久一二三区| 欧美高清一级片在线观看| 亚洲精品视频在线看| 亚洲国产精品久久人人爱蜜臀| 日韩精品午夜视频| 国产91丝袜在线播放| 99精品视频在线播放观看| 欧美网站大全在线观看| 精品日韩一区二区三区免费视频| 久久久久久久久一| 亚洲美女精品一区| 日本aⅴ免费视频一区二区三区| 国产一区二区三区高清播放| 91精品福利在线| 久久久久久久综合日本| 亚洲精品水蜜桃| 精品亚洲aⅴ乱码一区二区三区| 一本大道久久精品懂色aⅴ| 欧美一级黄色录像| 亚洲视频在线观看三级| 麻豆91在线播放免费| 色婷婷一区二区| 国产亚洲成aⅴ人片在线观看| 一区二区免费在线| 成人毛片视频在线观看| 欧美精品免费视频| 国产精品国产自产拍高清av| 精品午夜久久福利影院| 欧美性三三影院| 国产精品欧美经典| 国产一区二区三区在线观看免费| 欧美日韩在线电影| 一二三四区精品视频| 成人av在线影院| 国产欧美日韩卡一| 国产精品91一区二区| 5858s免费视频成人| 亚洲一区二区三区免费视频| k8久久久一区二区三区| 久久奇米777| 国产一区二区三区不卡在线观看 | 亚洲欧美另类久久久精品2019| 国产大陆精品国产| 久久精品综合网| 国产成人精品免费| 国产欧美一区二区精品性色超碰| 精油按摩中文字幕久久| 精品国内二区三区| 国产美女一区二区三区| 久久亚洲私人国产精品va媚药| 美女网站色91| 精品成人a区在线观看| 国产精品综合在线视频| 欧美国产乱子伦| 成人av电影在线| 亚洲精品久久嫩草网站秘色| 欧美视频一区二区在线观看| 五月天一区二区三区| 欧美精品在欧美一区二区少妇| 日韩一区精品字幕| 欧美mv和日韩mv国产网站| 国产精品一区二区男女羞羞无遮挡 | 亚洲视频一区在线| 欧美精品xxxxbbbb| 看电视剧不卡顿的网站| 中国色在线观看另类| 一本大道久久a久久综合| 午夜私人影院久久久久| 精品福利在线导航| 91在线精品一区二区| 亚洲成人一区在线| 亚洲精品在线观看网站| 中文字幕永久在线不卡| 国产美女精品人人做人人爽| 成人欧美一区二区三区白人 | 日韩**一区毛片| 国产精品久久国产精麻豆99网站 | 国产高清成人在线| 一区av在线播放| 久久女同性恋中文字幕| 欧洲亚洲精品在线| 国产成人精品亚洲午夜麻豆| 亚洲18色成人| 成人欧美一区二区三区视频网页| 这里是久久伊人| 色诱视频网站一区| 国产在线精品一区在线观看麻豆| 一区二区三区欧美久久| 国产午夜精品一区二区三区嫩草 | 一区在线播放视频| 久久亚洲精精品中文字幕早川悠里| 91日韩一区二区三区| 国产精品一区二区你懂的| 丝袜美腿高跟呻吟高潮一区| 亚洲老司机在线| 国产日韩欧美不卡| 欧美成人精品3d动漫h| 欧美日韩1区2区| 在线亚洲人成电影网站色www| 成人黄色在线看| 韩国欧美一区二区| 日本欧美韩国一区三区| 午夜久久久久久久久久一区二区| 亚洲精品日韩一| 亚洲视频在线一区| 国产精品久久久久aaaa樱花| 中文字幕乱码久久午夜不卡 | 91在线精品一区二区| av网站免费线看精品| 成人免费va视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 91在线播放网址| 一本一本大道香蕉久在线精品| 色综合久久中文综合久久97| 99久久精品国产观看| 一本久久a久久免费精品不卡| 91一区在线观看| 在线视频国产一区| 3atv在线一区二区三区| 日韩欧美一级二级| 欧美精品一区二区三区很污很色的| 精品福利视频一区二区三区| 国产午夜精品久久久久久久 | 欧美xfplay| 日本一区免费视频| 亚洲日本丝袜连裤袜办公室| 性做久久久久久久免费看| 捆绑紧缚一区二区三区视频| 国产原创一区二区三区| 波多野结衣中文字幕一区二区三区| 一本久道久久综合中文字幕| 欧美亚洲动漫另类| 欧美大片拔萝卜| 中文字幕综合网| 天天操天天干天天综合网| 国产精品一二三在| 91免费版在线看| 日韩美女在线视频| 亚洲视频一二区| 美女网站一区二区| 日本高清不卡aⅴ免费网站| 日韩免费高清av| 亚洲精品你懂的| 久草这里只有精品视频| 色婷婷国产精品久久包臀| 久久免费的精品国产v∧| 亚洲精品久久久蜜桃| 国模娜娜一区二区三区|