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

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

?? mpi.c

?? 最新版本的加密解密算法庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* Start: 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 */#include <ltc_tommath.h>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";}/* End: bn_error.c *//* Start: 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 */#include <ltc_tommath.h>/* computes the modular inverse via binary extended euclidean algorithm,  * that is c = 1/a mod b  * * Based on mp_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 __ERR;  }  /* we need y = |a| */  if ((res = mp_abs (a, &y)) != MP_OKAY) {    goto __ERR;  }  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */  if ((res = mp_copy (&x, &u)) != MP_OKAY) {    goto __ERR;  }  if ((res = mp_copy (&y, &v)) != MP_OKAY) {    goto __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 __ERR;    }    /* 4.2 if B is odd then */    if (mp_isodd (&B) == 1) {      if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) {        goto __ERR;      }    }    /* B = B/2 */    if ((res = mp_div_2 (&B, &B)) != MP_OKAY) {      goto __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 __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 __ERR;      }    }    /* D = D/2 */    if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {      goto __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 __ERR;    }    if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) {      goto __ERR;    }  } else {    /* v - v - u, D = D - B */    if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) {      goto __ERR;    }    if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) {      goto __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 __ERR;  }  /* b is now the inverse */  neg = a->sign;  while (D.sign == MP_NEG) {    if ((res = mp_add (&D, b, &D)) != MP_OKAY) {      goto __ERR;    }  }  mp_exch (&D, c);  c->sign = neg;  res = MP_OKAY;__ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL);  return res;}/* End: bn_fast_mp_invmod.c *//* Start: 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 */#include <ltc_tommath.h>/* computes xR**-1 == x (mod N) via Montgomery Reduction * * This is an optimized implementation of mp_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;}/* End: bn_fast_mp_montgomery_reduce.c *//* Start: 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 */#include <ltc_tommath.h>/* 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;  mp_word W[MP_WARRAY];  /* grow the destination as required */  if (c->alloc < digs) {    if ((res = mp_grow (c, digs)) != MP_OKAY) {      return res;    }  }  /* clear temp buf (the columns) */  memset (W, 0, sizeof (mp_word) * digs);  /* calculate the columns */  pa = a->used;  for (ix = 0; ix < pa; ix++) {    /* this multiplier has been modified to allow you to      * control how many digits of output are produced.       * So at most we want to make upto "digs" digits of output.     *     * this adds products to distinct columns (at ix+iy) of W     * note that each step through the loop is not dependent on     * the previous which means the compiler can easily unroll     * the loop without scheduling problems     */    {      register mp_digit tmpx, *tmpy;      register mp_word *_W;      register int iy, pb;      /* alias for the the word on the left e.g. A[ix] * A[iy] */      tmpx = a->dp[ix];      /* alias for the right side */      tmpy = b->dp;      /* alias for the columns, each step through the loop adds a new         term to each column       */      _W = W + ix;      /* the number of digits is limited by their placement.  E.g.         we avoid multiplying digits that will end up above the # of         digits of precision requested       */      pb = MIN (b->used, digs - ix);      for (iy = 0; iy < pb; iy++) {        *_W++ += ((mp_word)tmpx) * ((mp_word)*tmpy++);      }    }  }  /* setup dest */  olduse  = c->used;  c->used = digs;  {    register mp_digit *tmpc;    /* At this point W[] contains the sums of each column.  To get the     * correct result we must take the extra bits from each column and     * carry them down     *     * Note that while this adds extra code to the multiplier it      * saves time since the carry propagation is removed from the      * above nested loop.This has the effect of reducing the work      * from N*(N+N*c)==N**2 + c*N**2 to N**2 + N*c where c is the      * cost of the shifting.  On very small numbers this is slower      * but on most cryptographic size numbers it is faster.     *     * In this particular implementation we feed the carries from     * behind which means when the loop terminates we still have one     * last digit to copy     */    tmpc = c->dp;    for (ix = 1; ix < digs; ix++) {      /* forward the carry from the previous temp */      W[ix] += (W[ix - 1] >> ((mp_word) DIGIT_BIT));      /* now extract the previous digit [below the carry] */      *tmpc++ = (mp_digit) (W[ix - 1] & ((mp_word) MP_MASK));    }    /* fetch the last digit */    *tmpc++ = (mp_digit) (W[digs - 1] & ((mp_word) MP_MASK));    /* clear unused digits [that existed in the old copy of c] */    for (; ix < olduse; ix++) {      *tmpc++ = 0;    }  }  mp_clamp (c);  return MP_OKAY;}/* End: bn_fast_s_mp_mul_digs.c *//* Start: 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 */ #include <ltc_tommath.h>/* this is a modified version of fast_s_mp_mul_digs that only produces * output digits *above* digs.  See the comments for fast_s_mp_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)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品538一区二区在线| 玉米视频成人免费看| 国产一区二区在线观看免费| 日韩女优视频免费观看| 国产一区不卡视频| 国产无人区一区二区三区| 国产福利一区二区三区| 国产精品美女久久久久久久久 | 亚洲一卡二卡三卡四卡| 久久久国际精品| 国产91在线观看丝袜| 国产精品久久久久久久久搜平片 | 久久久亚洲精华液精华液精华液| 国产精品中文欧美| 国产精品成人网| 99国产精品视频免费观看| 亚洲国产日韩av| 欧美大肚乱孕交hd孕妇| 国产成人av电影免费在线观看| 中文字幕一区二区三区蜜月 | 免费成人av在线播放| 国产欧美精品国产国产专区 | 欧美四级电影网| 蜜臀av一区二区| 日本一区二区成人| 色国产精品一区在线观看| 男女男精品视频| 国产精品素人视频| 欧美日韩高清一区二区不卡| 国产在线播放一区| 一区二区三区在线影院| 欧美一区二区观看视频| 成年人网站91| 九一久久久久久| 亚洲欧美视频在线观看| 日韩美女在线视频| 在线一区二区三区| 国产精品综合视频| 五月婷婷欧美视频| 中文字幕在线不卡一区二区三区| 91精品黄色片免费大全| 99精品视频一区二区三区| 久久成人av少妇免费| 1区2区3区欧美| 欧美自拍丝袜亚洲| 成人激情黄色小说| 久久99国产精品免费| 日本欧洲一区二区| 青青青爽久久午夜综合久久午夜| 久久久久免费观看| 91麻豆精品国产91久久久使用方法 | 国产福利91精品一区二区三区| 亚洲精品国产品国语在线app| 久久精品亚洲精品国产欧美kt∨| 久久嫩草精品久久久精品| 欧美三级电影在线看| jlzzjlzz亚洲日本少妇| 国产伦精一区二区三区| 麻豆国产欧美日韩综合精品二区 | 日韩成人午夜精品| 亚洲精品国产一区二区精华液| 欧美激情自拍偷拍| 久久久亚洲精华液精华液精华液| 日韩一区二区三区免费看| 欧亚一区二区三区| 一本色道久久综合亚洲91| 成人小视频在线观看| 国产精品资源在线| 奇米影视一区二区三区| 天堂影院一区二区| 五月天国产精品| 午夜免费久久看| 一区二区在线看| 一区二区三区av电影| 亚洲视频精选在线| 亚洲欧美一区二区视频| 中文字幕日韩一区二区| 成人欧美一区二区三区黑人麻豆| 中文字幕中文字幕一区| 国产精品萝li| 亚洲色图另类专区| 亚洲女同一区二区| 亚洲综合图片区| 亚洲6080在线| 久久精品国产成人一区二区三区 | 韩国av一区二区三区在线观看 | 国产传媒久久文化传媒| 国产一区二区不卡老阿姨| 国产成人精品亚洲777人妖| 国产成人夜色高潮福利影视| 丁香六月综合激情| 亚洲三级理论片| 日韩伦理电影网| 亚洲精品亚洲人成人网在线播放| 亚洲欧美日韩国产综合在线 | 久久久亚洲精品石原莉奈 | 欧美精品一区二区三区在线| 久久一区二区三区四区| 国产精品毛片a∨一区二区三区 | 日韩高清在线观看| 狠狠色狠狠色合久久伊人| 大美女一区二区三区| 色94色欧美sute亚洲线路一久| 欧美午夜理伦三级在线观看| 日韩精品专区在线影院重磅| 国产欧美日本一区视频| 一区二区三区在线观看国产| 三级精品在线观看| 国产成人综合亚洲91猫咪| 欧美最猛性xxxxx直播| 欧美成人女星排名| 国产精品卡一卡二| 亚洲va天堂va国产va久| 亚洲国产成人私人影院tom| 欧美日韩国产影片| 91精品国产一区二区三区香蕉| 日韩免费性生活视频播放| 中文字幕av在线一区二区三区| 一区二区三区在线看| 精品一区二区三区蜜桃| 91网页版在线| 欧美精品一区二区蜜臀亚洲| 亚洲卡通动漫在线| 精品亚洲免费视频| 欧美在线不卡视频| 国产欧美日韩另类一区| 亚洲国产精品视频| 成人免费视频视频| 日韩午夜激情av| 亚洲一级电影视频| 毛片av一区二区三区| 成人动漫视频在线| 欧美一区二区在线免费观看| 亚洲人成精品久久久久| 国产一区二区三区四| 欧美肥胖老妇做爰| 亚洲男人天堂一区| 国产福利精品一区二区| 日韩午夜激情av| 亚洲成人激情av| 91在线视频18| 国产精品午夜久久| 久久精品久久久精品美女| 欧美视频精品在线观看| 亚洲欧美日韩在线| av一本久道久久综合久久鬼色| 久久夜色精品国产噜噜av | 亚洲一区二区视频在线观看| 国产精品白丝jk白祙喷水网站| 在线不卡的av| 亚洲综合一二三区| 91麻豆国产自产在线观看| 国产丝袜欧美中文另类| 久久99精品国产麻豆婷婷| 91精品国产综合久久福利| 亚洲高清不卡在线| 欧美手机在线视频| 亚洲人精品午夜| 成人高清视频在线观看| 国产精品久久午夜| 成人一道本在线| 国产精品网站在线| 不卡欧美aaaaa| 国产精品不卡在线| 91首页免费视频| 亚洲免费在线视频| 日本黄色一区二区| 亚洲成av人片观看| 欧美精品成人一区二区三区四区| 亚洲第一福利一区| 欧美卡1卡2卡| 日本强好片久久久久久aaa| 欧美一区二区三区免费大片| 免费一级欧美片在线观看| 日韩一区二区三区精品视频 | 国产精品一区专区| 久久精品一区二区三区av | 在线视频一区二区三区| 一区二区欧美精品| 欧美片网站yy| 精品一区二区成人精品| 久久久久国产精品免费免费搜索| 国产高清成人在线| 国产精品视频看| 色婷婷久久久亚洲一区二区三区 | 欧美va亚洲va| 岛国精品在线播放| 一区二区三区不卡在线观看 | 欧美午夜精品一区| 日本午夜一本久久久综合| 精品免费视频一区二区| 国产91精品久久久久久久网曝门 | 91麻豆免费观看| 亚洲国产aⅴ成人精品无吗| 日韩三级电影网址| jlzzjlzz亚洲女人18| 午夜成人免费视频| 国产亚洲一区字幕| 91久久人澡人人添人人爽欧美| 日本视频在线一区|