亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩欧美国产小视频| 欧美一级理论性理论a| 青青国产91久久久久久| 亚洲国产高清aⅴ视频| 欧美日韩精品一区二区三区四区| 国产乱色国产精品免费视频| 天堂久久久久va久久久久| 中文字幕欧美激情一区| 欧美一区二区精品久久911| 一本久道中文字幕精品亚洲嫩 | 精品视频色一区| 亚洲裸体在线观看| 欧美撒尿777hd撒尿| 亚洲色图在线播放| 色丁香久综合在线久综合在线观看| 国产日韩欧美不卡| 欧美中文字幕一区二区三区亚洲 | 欧美成人性战久久| 午夜精品影院在线观看| 亚洲欧美日韩国产手机在线| 久久蜜桃av一区精品变态类天堂| 制服丝袜av成人在线看| 欧美视频日韩视频在线观看| 一本大道久久a久久综合婷婷| 成人中文字幕在线| 国产一区二区毛片| 久久99日本精品| 午夜精品久久久久久久| 亚洲一区在线观看视频| 一区二区在线观看免费| 亚洲色图另类专区| 亚洲女同一区二区| 综合久久一区二区三区| 国产精品国产三级国产三级人妇| 中文字幕第一区二区| 国产欧美综合在线| 欧美激情一区二区三区蜜桃视频| 久久精品一区四区| 国产精品网站在线观看| 国产精品婷婷午夜在线观看| 国产色产综合产在线视频| 国产亚洲欧洲一区高清在线观看| 亚洲精品在线网站| 日本一区二区三区免费乱视频| 欧美国产精品久久| 亚洲欧洲另类国产综合| 综合婷婷亚洲小说| 亚洲第一搞黄网站| 久久国产人妖系列| 国产乱子伦一区二区三区国色天香| 国产精品原创巨作av| 成人永久看片免费视频天堂| 成人国产电影网| 在线观看www91| 69成人精品免费视频| 欧美精品一区二区在线播放| 国产欧美综合色| 最新日韩av在线| 亚州成人在线电影| 久久超级碰视频| 成人免费毛片片v| 欧美午夜在线观看| 日韩一区二区电影网| 久久久国产午夜精品 | 国产欧美日韩另类一区| 国产精品中文字幕一区二区三区| 韩日欧美一区二区三区| 日本道色综合久久| 精品1区2区3区| 欧美一区二区三区在线电影| 欧美一区二区视频免费观看| 欧美日本乱大交xxxxx| 欧美亚洲综合色| 日韩西西人体444www| 精品久久久久久最新网址| 久久久久国产精品厨房| 欧美一区二区三区小说| 91精品蜜臀在线一区尤物| 精品国产第一区二区三区观看体验| 欧美国产欧美亚州国产日韩mv天天看完整| 最近中文字幕一区二区三区| 日韩精品亚洲一区二区三区免费| 国产精品99久久久久久久女警| 色综合久久久网| 精品国产免费一区二区三区四区| 国产精品麻豆一区二区| 欧美96一区二区免费视频| 成人免费毛片aaaaa**| 欧美精品免费视频| 国产精品欧美一区二区三区| 丝袜脚交一区二区| 成人97人人超碰人人99| 日韩免费视频一区| 亚洲一区免费在线观看| 国产成人综合在线观看| 欧美日韩aaa| 最新国产の精品合集bt伙计| 国产综合久久久久影院| 欧美日韩一区三区四区| 国产精品久久久久久久久晋中| 日韩av一区二区在线影视| 99国产麻豆精品| 久久影院视频免费| 亚洲成人精品影院| 色综合色综合色综合| 国产午夜精品福利| 青青草国产成人99久久| 欧洲激情一区二区| 中文字幕乱码久久午夜不卡| 另类中文字幕网| 欧美精品xxxxbbbb| 亚洲主播在线播放| 99精品国产99久久久久久白柏 | 欧美久久一二三四区| 国产精品成人在线观看| 国产精品亚洲专一区二区三区| 欧美一区二区网站| 天堂久久久久va久久久久| 欧美系列一区二区| 亚洲午夜精品网| 日本精品免费观看高清观看| 国产精品久久毛片a| 丰满白嫩尤物一区二区| 久久久久综合网| 国产黄色91视频| 国产午夜精品一区二区| 国产高清久久久| 国产色爱av资源综合区| 国产高清无密码一区二区三区| www精品美女久久久tv| 99精品国产99久久久久久白柏| 中文字幕人成不卡一区| 国产精品午夜在线观看| 777精品伊人久久久久大香线蕉| 日韩精品每日更新| www国产成人| 色久优优欧美色久优优| 免费美女久久99| 亚洲欧美成人一区二区三区| 5566中文字幕一区二区电影 | 精品电影一区二区| 亚洲婷婷在线视频| 国产在线精品不卡| 久久一二三国产| 国产成人激情av| 国产精品全国免费观看高清| 国产aⅴ综合色| 亚洲欧洲成人自拍| 欧美性淫爽ww久久久久无| 亚洲午夜久久久| 日韩视频免费观看高清完整版 | 国产精品一区二区三区网站| 欧美精品一区二区久久婷婷| 国产一区欧美日韩| 中文无字幕一区二区三区| 91视频免费播放| 午夜精品一区二区三区免费视频| 91精品国产入口| 国产精品一级二级三级| 中文字幕一区二区三| 91电影在线观看| 丝袜国产日韩另类美女| 久久久综合激的五月天| 波多野洁衣一区| 午夜成人免费电影| 国产日韩v精品一区二区| 91免费视频网| 日本aⅴ免费视频一区二区三区 | 亚洲欧美一区二区不卡| 欧美精品久久一区| 国产精品自拍网站| 亚洲精品成a人| 日韩精品一区二区三区视频| 99精品国产热久久91蜜凸| 日本中文一区二区三区| 国产欧美精品一区aⅴ影院| 在线看国产日韩| 国产真实乱对白精彩久久| 亚洲欧美乱综合| 日韩精品一区二区三区在线播放| 99在线精品观看| 免费一区二区视频| 国产精品久久毛片| 日韩欧美精品在线视频| 91丨porny丨户外露出| 精品一区在线看| 亚洲在线观看免费| 国产亚洲欧洲997久久综合| 欧美性大战久久久久久久蜜臀| 国模娜娜一区二区三区| 亚洲午夜久久久久久久久久久| 久久久久久久久一| 欧美精品在线视频| 91在线一区二区三区| 国产精品一二三| 日本中文字幕一区| 亚洲国产一区二区三区| 日本一区二区三区四区| 丁香啪啪综合成人亚洲小说| 欧美优质美女网站|