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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久一区二区三区| 欧美特级限制片免费在线观看| 国产精品欧美极品| 欧美日韩成人在线| 成人爱爱电影网址| 精品系列免费在线观看| 夜色激情一区二区| 中文字幕av不卡| 欧美大黄免费观看| 欧美三级乱人伦电影| 成人av在线影院| 韩国欧美一区二区| 午夜av一区二区| 国产精品成人免费在线| 2020国产精品久久精品美国| 欧美猛男男办公室激情| 色婷婷综合久色| 成人的网站免费观看| 国产成人日日夜夜| 韩国成人福利片在线播放| 日韩电影一二三区| 亚洲国产精品天堂| 一级特黄大欧美久久久| 国产精品久久久久四虎| 国产清纯白嫩初高生在线观看91 | 亚洲激情一二三区| 国产欧美精品国产国产专区| 精品国产自在久精品国产| 91超碰这里只有精品国产| 欧美性欧美巨大黑白大战| 色94色欧美sute亚洲线路二| 波多野结衣在线一区| 成人三级在线视频| 成人免费视频app| 成人国产一区二区三区精品| 国产99久久久久| 懂色av中文一区二区三区| 国产精品18久久久久久久久久久久 | 国产精品日韩精品欧美在线| 久久久99免费| 国产日韩成人精品| 中文字幕久久午夜不卡| 国产精品入口麻豆九色| 18欧美亚洲精品| 亚洲另类色综合网站| 一区二区三区日韩在线观看| 一区二区三区日本| 亚洲狠狠爱一区二区三区| 丝袜亚洲精品中文字幕一区| 日韩制服丝袜先锋影音| 免费在线视频一区| 国产精品一区二区视频| 成人精品国产福利| 色综合久久天天| 欧美日韩www| 欧美一级xxx| 久久久久国产精品免费免费搜索| 国产欧美日本一区视频| 亚洲欧美另类在线| 午夜视频一区在线观看| 久久av中文字幕片| 成人福利视频网站| 色视频一区二区| 欧美一区二区三区性视频| ww久久中文字幕| 国产精品久久777777| 亚洲五码中文字幕| 国内外成人在线| 99久久婷婷国产精品综合| 欧美日韩在线免费视频| 欧美成人一区二区三区| 国产精品沙发午睡系列990531| 一区二区三区日韩欧美| 看国产成人h片视频| 成人黄色777网| 欧美日韩高清一区二区| 久久久精品中文字幕麻豆发布| 综合激情网...| 日本欧美久久久久免费播放网| 国产超碰在线一区| 欧美中文字幕一区二区三区亚洲| 日韩久久免费av| 亚洲人亚洲人成电影网站色| 青青草精品视频| 99国产一区二区三精品乱码| 日韩一区二区三区电影| 最新热久久免费视频| 老鸭窝一区二区久久精品| 99久久免费国产| 欧美va亚洲va国产综合| 亚洲综合男人的天堂| 国产精品77777竹菊影视小说| 欧美最猛性xxxxx直播| 久久精品一区二区三区不卡| 亚洲成精国产精品女| 成人免费黄色在线| 日韩三级伦理片妻子的秘密按摩| 亚洲日本va午夜在线影院| 韩国毛片一区二区三区| 欧美日韩你懂的| 裸体在线国模精品偷拍| 视频一区二区不卡| 免费成人性网站| 91精彩视频在线观看| 国产午夜精品一区二区三区视频| 午夜精品福利视频网站| 91欧美一区二区| 国产喂奶挤奶一区二区三区| 天天综合日日夜夜精品| 色久综合一二码| 国产亚洲欧洲997久久综合| 青青青伊人色综合久久| 欧美视频日韩视频| 成人欧美一区二区三区黑人麻豆| 国产自产v一区二区三区c| 7777女厕盗摄久久久| 亚洲综合色自拍一区| 91在线无精精品入口| 欧美激情在线免费观看| 极品销魂美女一区二区三区| 欧美一区二区三区在线视频| 亚洲第一搞黄网站| 色噜噜狠狠一区二区三区果冻| 国产精品麻豆网站| 懂色av一区二区三区免费看| 精品国产乱码久久久久久1区2区 | 一本在线高清不卡dvd| 国产精品视频观看| 成人一区二区三区视频| 亚洲国产精品ⅴa在线观看| 国产福利一区二区三区视频| 久久久五月婷婷| 国产精品一区二区久激情瑜伽| 精品免费国产一区二区三区四区| 免费观看一级欧美片| 欧美不卡123| 精品在线视频一区| 2020国产成人综合网| 韩日av一区二区| 久久久精品国产99久久精品芒果| 国产精品自拍av| 国产色爱av资源综合区| 成人免费毛片嘿嘿连载视频| 中文字幕一区二区三区av| 99久精品国产| 亚洲一区在线视频观看| 欧美精品v国产精品v日韩精品| 日本中文一区二区三区| 精品乱人伦小说| 懂色中文一区二区在线播放| 亚洲欧美日韩中文字幕一区二区三区| 91麻豆swag| 午夜精品久久久久影视| 日韩精品一区在线观看| 国产福利精品导航| 自拍偷拍国产精品| 欧美日韩在线精品一区二区三区激情 | 蜜臀久久久99精品久久久久久| 日韩午夜av电影| 国产福利一区在线观看| 专区另类欧美日韩| 欧美日韩国产免费| 激情文学综合丁香| 综合欧美一区二区三区| 欧美日韩国产成人在线免费| 国产中文一区二区三区| 日韩一区欧美一区| 欧美精品第1页| 国产高清精品网站| 亚洲国产日产av| 久久九九久久九九| 欧美日韩一本到| 国产精品自拍网站| 亚洲成国产人片在线观看| 久久综合九色综合欧美就去吻| 91在线视频播放| 另类小说色综合网站| 亚洲欧美综合在线精品| 91麻豆精品国产91久久久久久久久| 国产露脸91国语对白| 亚洲制服欧美中文字幕中文字幕| 精品人在线二区三区| 91蜜桃在线免费视频| 激情图区综合网| 亚洲宅男天堂在线观看无病毒| 亚洲精品一区二区三区香蕉| 在线亚洲一区二区| 国产乱对白刺激视频不卡| 亚洲bt欧美bt精品777| 中文字幕精品在线不卡| 亚洲一区视频在线| 亚洲精品一线二线三线| 欧美性一级生活| 成人黄动漫网站免费app| 美女精品一区二区| 亚洲男人的天堂在线观看| 久久理论电影网| 日韩一卡二卡三卡四卡| 色婷婷综合视频在线观看| 国产不卡在线播放|