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

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

?? mpi.c

?? 該壓縮包中包括 tom的加密函數(shù)庫及pdf說明 ,以及Rinick s ECC:橢圓曲線非對稱加密密鑰生成器
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* Start: bn_error.c */#include <ltc_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@gmail.com, 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 <ltc_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@gmail.com, 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 */int fast_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_mod (a, b, &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 <ltc_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@gmail.com, 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.*/int fast_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 <ltc_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@gmail.com, 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. * */int fast_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          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] = (mp_digit)(_W & MP_MASK);  /* setup dest */  olduse  = c->used;  c->used = pa;  {    register mp_digit *tmpc;    tmpc = c->dp;    for (ix = 0; ix < pa+1; 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 <ltc_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@gmail.com, 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. */int fast_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 */      W[ix] = ((mp_digit)_W) & MP_MASK;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合在线观看色| 精品国产凹凸成av人导航| 免费观看91视频大全| 亚洲图片有声小说| 夜夜爽夜夜爽精品视频| 亚洲精品欧美激情| 一区二区三区四区不卡在线| 亚洲视频1区2区| 一区精品在线播放| 日韩影院在线观看| 爽爽淫人综合网网站| 午夜亚洲福利老司机| 日本va欧美va瓶| 老司机免费视频一区二区三区| 日韩中文字幕区一区有砖一区 | 国产在线乱码一区二区三区| 亚洲成人免费av| 日韩中文字幕一区二区三区| 男人的j进女人的j一区| 蜜桃视频第一区免费观看| 欧美一卡二卡三卡四卡| 欧美日韩国产综合久久| 丁香激情综合五月| 欧美精品一级二级| 亚洲国产精品久久艾草纯爱 | 美腿丝袜亚洲三区| 欧洲精品一区二区三区在线观看| 精品国产凹凸成av人网站| 亚洲精品国产精品乱码不99| 国内精品在线播放| 国产亚洲精品久| 美女网站色91| 91精品国产91久久久久久一区二区| 亚洲免费观看在线观看| 国产一区二区剧情av在线| 国产日韩欧美精品在线| 成人免费三级在线| 亚洲手机成人高清视频| 欧美视频第二页| 国内精品伊人久久久久av影院 | 在线观看一区二区精品视频| 亚洲人成影院在线观看| 精品视频一区二区不卡| 偷拍自拍另类欧美| 国产欧美精品国产国产专区| 国内精品久久久久影院一蜜桃| 国产欧美日韩麻豆91| 91浏览器在线视频| 老司机精品视频线观看86| 日本一区二区不卡视频| 欧美日韩一级二级| av电影在线观看不卡| 狠狠色综合色综合网络| 国产精品久久久久久久久晋中| 欧美日韩电影在线| 99久久99久久久精品齐齐| 精品在线观看视频| 日韩不卡一二三区| 亚洲乱码日产精品bd| 久久久久久久av麻豆果冻| 欧美高清激情brazzers| 在线精品视频小说1| 色综合久久久久综合| 成人性生交大片免费看视频在线| 亚洲成av人片www| 亚洲国产日产av| 亚洲国产欧美在线人成| 亚洲成av人影院在线观看网| 日韩精品91亚洲二区在线观看| 亚洲国产日产av| 麻豆视频观看网址久久| 激情综合色播激情啊| 国产综合色精品一区二区三区| 九九精品视频在线看| 国产美女娇喘av呻吟久久| 国产精品18久久久久| av高清不卡在线| 欧美亚洲国产一区二区三区va| 欧美三级日韩三级| 2020国产精品| 亚洲免费资源在线播放| 亚洲一区二区三区中文字幕| 天堂一区二区在线| 国产精品一区2区| 欧美视频一区二| 国产精品久久久久影院色老大| 亚洲午夜av在线| 国产剧情一区在线| 3atv在线一区二区三区| 亚洲日本成人在线观看| 美女免费视频一区二区| 一本色道亚洲精品aⅴ| 26uuu欧美| 久久精品国产一区二区三 | 一区二区三区四区中文字幕| 日韩国产高清在线| 欧美在线三级电影| 中文字幕在线播放不卡一区| 国产精品一区在线| 26uuu欧美日本| 国产乱人伦偷精品视频不卡| 日韩欧美资源站| 国产精品一二三在| 国产精品区一区二区三区| 国产成人在线免费| 中文字幕的久久| av爱爱亚洲一区| 一区二区三区在线播放| 91久久线看在观草草青青| 一区二区高清视频在线观看| 在线观看三级视频欧美| 奇米四色…亚洲| 国产精品久久久久永久免费观看 | 亚洲另类春色校园小说| 欧美午夜寂寞影院| 久久99精品国产91久久来源| 亚洲国产精品ⅴa在线观看| 91女人视频在线观看| 日本成人中文字幕在线视频| 欧美成人精品1314www| 丰满少妇久久久久久久| 亚洲18色成人| 中文一区在线播放| 欧美一区日本一区韩国一区| 国产成人av一区| 天堂成人国产精品一区| 精品国产三级电影在线观看| 一本到高清视频免费精品| 日韩激情中文字幕| 亚洲欧美经典视频| 日本一区二区三区久久久久久久久不 | 色成人在线视频| 福利一区二区在线观看| 美国欧美日韩国产在线播放| 亚洲黄网站在线观看| 国产精品久久久久久久久久免费看| 欧美色图第一页| 欧美日韩激情在线| 91国内精品野花午夜精品| 国产高清不卡一区| 国产成人在线视频播放| 成人黄色一级视频| jizzjizzjizz欧美| 91在线无精精品入口| 99久久婷婷国产| 欧美在线观看禁18| 欧美午夜免费电影| 欧美色综合久久| 911精品国产一区二区在线| 欧美一区二区三区性视频| 91精品国产色综合久久不卡蜜臀 | 欧美经典一区二区三区| 国产精品福利一区| 亚洲综合男人的天堂| 日韩av在线免费观看不卡| 国产原创一区二区| 9久草视频在线视频精品| 在线观看成人小视频| 欧美一级二级三级蜜桃| 国产欧美一区二区精品性| 中文字幕制服丝袜成人av | 播五月开心婷婷综合| 欧美日韩黄色一区二区| 久久嫩草精品久久久精品一| 亚洲男女一区二区三区| 国内一区二区视频| 欧美一区二区人人喊爽| 日韩伦理电影网| 国产成a人亚洲精| 欧美一区二区三级| 亚洲成年人网站在线观看| 91丝袜国产在线播放| 日韩你懂的在线观看| 亚洲成人免费看| 欧美视频在线一区| 一区二区三区久久| 色噜噜久久综合| 国产精品色哟哟| 国产成人亚洲综合a∨婷婷图片| 在线视频亚洲一区| 综合久久给合久久狠狠狠97色| 极品销魂美女一区二区三区| 欧美一区国产二区| 理论电影国产精品| 日韩免费观看高清完整版| 精品一区二区日韩| 久久久精品国产免费观看同学| 美国十次综合导航| 久久久99精品久久| 波多野结衣视频一区| 亚洲精品美国一| 欧美一区二区视频在线观看| 麻豆精品久久精品色综合| 日韩免费高清电影| 成人动漫一区二区| 夜夜精品浪潮av一区二区三区| 在线亚洲欧美专区二区| 免费成人av在线| 亚洲欧美日韩一区二区| 欧美伦理电影网|