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

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

?? ecc.c

?? C語言
?? C
?? 第 1 頁 / 共 5 頁
字號:
  /* compare based on sign */
  if (a->sign != b->sign) {
     if (a->sign == MP_NEG) {
        return MP_LT;
     } else {
        return MP_GT;
     }
  }
  
  /* compare digits */
  if (a->sign == MP_NEG) {
     /* if negative compare opposite direction */
     return mp_cmp_mag(b, a);
  } else {
     return mp_cmp_mag(a, b);
  }
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_MUL_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://libtom.org
 */

/* high level multiplication (handles sign) */
int mp_mul (mp_int * a, mp_int * b, mp_int * c)
{
  int     res, neg;
  neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;

  /* use Toom-Cook? */
#ifdef BN_MP_TOOM_MUL_C
  if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) {
    res = mp_toom_mul(a, b, c);
  } else 
#endif
#ifdef BN_MP_KARATSUBA_MUL_C
  /* use Karatsuba? */
  if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) {
    res = mp_karatsuba_mul (a, b, c);
  } else 
#endif
  {
    /* can we use the fast multiplier?
     *
     * The fast multiplier can be used if the output will 
     * have less than MP_WARRAY digits and the number of 
     * digits won't affect carry propagation
     */
    int     digs = a->used + b->used + 1;

#ifdef BN_FAST_S_MP_MUL_DIGS_C
    if ((digs < MP_WARRAY) &&
        MIN(a->used, b->used) <= 
        (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
      res = fast_s_mp_mul_digs (a, b, c, digs);
    } else 
#endif
#ifdef BN_S_MP_MUL_DIGS_C
      res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */
#else
      res = MP_VAL;
#endif

  }
  c->sign = (c->used > 0) ? neg : MP_ZPOS;
  return res;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_SQRT_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://libtom.org
 */

/* this function is less generic than mp_n_root, simpler and faster */
int mp_sqrt(mp_int *arg, mp_int *ret) 
{
  int res;
  mp_int t1,t2;

  /* must be positive */
  if (arg->sign == MP_NEG) {
    return MP_VAL;
  }

  /* easy out */
  if (mp_iszero(arg) == MP_YES) {
    mp_zero(ret);
    return MP_OKAY;
  }

  if ((res = mp_init_copy(&t1, arg)) != MP_OKAY) {
    return res;
  }

  if ((res = mp_init(&t2)) != MP_OKAY) {
    goto E2;
  }

  /* First approx. (not very bad for large arg) */
  mp_rshd (&t1,t1.used/2);

  /* t1 > 0  */ 
  if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
    goto E1;
  }
  if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
    goto E1;
  }
  if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
    goto E1;
  }
  /* And now t1 > sqrt(arg) */
  do { 
    if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
      goto E1;
    }
    if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
      goto E1;
    }
    if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
      goto E1;
    }
    /* t1 >= sqrt(arg) >= t2 at this point */
  } while (mp_cmp_mag(&t1,&t2) == MP_GT);

  mp_exch(&t1,ret);

E1: mp_clear(&t2);
E2: mp_clear(&t1);
  return res;
}

#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_INIT_COPY_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://libtom.org
 */

/* creates "a" then copies b into it */
int mp_init_copy (mp_int * a, mp_int * b)
{
  int     res;

  if ((res = mp_init (a)) != MP_OKAY) {
    return res;
  }
  return mp_copy (b, a);
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_COPY_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://libtom.org
 */

/* copy, b = a */
int
mp_copy (mp_int * a, mp_int * b)
{
  int     res, n;

  /* if dst == src do nothing */
  if (a == b) {
    return MP_OKAY;
  }

  /* grow dest */
  if (b->alloc < a->used) {
     if ((res = mp_grow (b, a->used)) != MP_OKAY) {
        return res;
     }
  }

  /* zero b and copy the parameters over */
  {
    register mp_digit *tmpa, *tmpb;

    /* pointer aliases */

    /* source */
    tmpa = a->dp;

    /* destination */
    tmpb = b->dp;

    /* copy all the digits */
    for (n = 0; n < a->used; n++) {
      *tmpb++ = *tmpa++;
    }

    /* clear high digits */
    for (; n < b->used; n++) {
      *tmpb++ = 0;
    }
  }

  /* copy used count and sign */
  b->used = a->used;
  b->sign = a->sign;
  return MP_OKAY;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_INIT_SET_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://libtom.org
 */

/* initialize and set a digit */
int mp_init_set (mp_int * a, mp_digit b)
{
  int err;
  if ((err = mp_init(a)) != MP_OKAY) {
     return err;
  }
  mp_set(a, b);
  return err;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_ZERO_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://libtom.org
 */

/* set to zero */
void mp_zero (mp_int * a)
{
  int       n;
  mp_digit *tmp;

  a->sign = MP_ZPOS;
  a->used = 0;

  tmp = a->dp;
  for (n = 0; n < a->alloc; n++) {
     *tmp++ = 0;
  }
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_SUB_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://libtom.org
 */

/* high level subtraction (handles signs) */
int
mp_sub (mp_int * a, mp_int * b, mp_int * c)
{
  int     sa, sb, res;

  sa = a->sign;
  sb = b->sign;

  if (sa != sb) {
    /* subtract a negative from a positive, OR */
    /* subtract a positive from a negative. */
    /* In either case, ADD their magnitudes, */
    /* and use the sign of the first number. */
    c->sign = sa;
    res = s_mp_add (a, b, c);
  } else {
    /* subtract a positive from a positive, OR */
    /* subtract a negative from a negative. */
    /* First, take the difference between their */
    /* magnitudes, then... */
    if (mp_cmp_mag (a, b) != MP_LT) {
      /* Copy the sign from the first */
      c->sign = sa;
      /* The first has a larger or equal magnitude */
      res = s_mp_sub (a, b, c);
    } else {
      /* The result has the *opposite* sign from */
      /* the first number. */
      c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS;
      /* The second has a larger magnitude */
      res = s_mp_sub (b, a, c);
    }
  }
  return res;
}

#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_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://libtom.org
 */

/* hac 14.61, pp608 */
int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
{
  /* b cannot be negative */
  if (b->sign == MP_NEG || mp_iszero(b) == 1) {
    return MP_VAL;
  }

#ifdef BN_FAST_MP_INVMOD_C
  /* if the modulus is odd we can use a faster routine instead */
  if (mp_isodd (b) == 1) {
    return fast_mp_invmod (a, b, c);
  }
#endif

#ifdef BN_MP_INVMOD_SLOW_C
  return mp_invmod_slow(a, b, c);
#endif

  return MP_VAL;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_MULMOD_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://libtom.org
 */

/* d = a * b (mod c) */
int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
{
  int     res;
  mp_int  t;

  if ((res = mp_init (&t)) != MP_OKAY) {
    return res;
  }

  if ((res = mp_mul (a, b, &t)) != MP_OKAY) {
    mp_clear (&t);
    return res;
  }
  res = mp_mod (&t, c, d);
  mp_clear (&t);
  return res;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_SUBMOD_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://libtom.org
 */

/* d = a - b (mod c) */
int
mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
{
  int     res;
  mp_int  t;


  if ((res = mp_init (&t)) != MP_OKAY) {
    return res;
  }

  if ((res = mp_sub (a, b, &t)) != MP_OKAY) {
    mp_clear (&t);
    return res;
  }
  res = mp_mod (&t, c, d);
  mp_clear (&t);
  return res;
}
#endif

/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */



#ifdef BN_MP_GROW_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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
黄色精品一二区| 日韩电影网1区2区| 91伊人久久大香线蕉| 亚洲欧美日韩小说| 欧美综合天天夜夜久久| 天天做天天摸天天爽国产一区 | 日韩在线一区二区| 日韩一级片网站| 懂色av一区二区夜夜嗨| 国产精品国产三级国产普通话99 | 日韩成人午夜精品| 26uuu欧美日本| 成人免费视频一区二区| 亚洲欧美偷拍另类a∨色屁股| 欧美在线一区二区三区| 人人超碰91尤物精品国产| 欧美大度的电影原声| av不卡在线播放| 午夜久久久久久久久| 精品国免费一区二区三区| 成人教育av在线| 亚洲国产欧美日韩另类综合| 欧美不卡123| 成人av在线一区二区| 亚洲成av人片在线观看无码| 精品91自产拍在线观看一区| 91在线视频18| 麻豆91小视频| 夜夜亚洲天天久久| 久久久99久久| 91精品国产色综合久久| 国产传媒久久文化传媒| 亚洲国产精品久久不卡毛片| 国产日韩欧美不卡| 欧美日产在线观看| 成人aa视频在线观看| 亚洲3atv精品一区二区三区| 国产欧美日韩另类一区| 91精品国产aⅴ一区二区| 成人精品在线视频观看| 久久av资源网| 亚洲国产你懂的| 中文字幕一区二区在线观看| 精品国产亚洲一区二区三区在线观看| 91婷婷韩国欧美一区二区| 精品影院一区二区久久久| 亚洲一区影音先锋| 中文字幕五月欧美| 久久久久久99久久久精品网站| 欧美日韩免费一区二区三区视频| 成人激情图片网| 狠狠色狠狠色合久久伊人| 亚洲国产一区在线观看| 亚洲欧美日韩国产综合| 国产视频911| 久久综合狠狠综合久久综合88| 欧美日韩高清影院| 色综合久久88色综合天天| 国产成人综合在线观看| 精品一区二区三区视频| 另类小说视频一区二区| 日韩电影免费在线看| 五月天网站亚洲| 夜色激情一区二区| 一级做a爱片久久| 亚洲精品国产精品乱码不99| 亚洲欧美日韩成人高清在线一区| 中文无字幕一区二区三区| 久久久综合九色合综国产精品| 欧美成人video| 日韩一二在线观看| 精品欧美乱码久久久久久1区2区| 日韩一区二区精品| 日韩欧美一级特黄在线播放| 日韩午夜在线影院| 精品久久久久久综合日本欧美| 欧美一级国产精品| 日韩亚洲欧美中文三级| 欧美成人官网二区| 久久亚洲免费视频| 国产女人18毛片水真多成人如厕 | 亚洲免费在线视频| 亚洲婷婷国产精品电影人久久| 国产精品毛片久久久久久久| 国产精品久久久久影院老司| 亚洲欧美另类在线| 亚洲一区二区欧美激情| 日韩国产成人精品| 久久国产麻豆精品| 国产成人精品免费在线| av一二三不卡影片| 欧美性猛片xxxx免费看久爱| 欧美军同video69gay| 精品久久久久久无| 国产精品黄色在线观看| 一区二区三区产品免费精品久久75| 亚洲永久精品国产| 麻豆专区一区二区三区四区五区| 精品一区二区成人精品| 成人黄色片在线观看| 欧美在线观看一区| 日韩三级精品电影久久久| 久久久九九九九| 依依成人精品视频| 久久66热re国产| 99国产精品99久久久久久| 制服.丝袜.亚洲.另类.中文| 久久综合丝袜日本网| 亚洲视频在线一区观看| 天天操天天干天天综合网| 国产精品中文有码| 欧美色老头old∨ideo| 欧美精品一区二区蜜臀亚洲| 亚洲三级免费观看| 麻豆国产精品官网| 色悠悠久久综合| 欧美mv日韩mv国产| 亚洲视频每日更新| 久久国内精品自在自线400部| a美女胸又www黄视频久久| 欧美久久一区二区| 国产精品电影一区二区| 美国三级日本三级久久99| av一本久道久久综合久久鬼色| 日韩欧美一级二级三级| 亚洲精品福利视频网站| 国产在线国偷精品免费看| 欧美性猛交xxxxxx富婆| 国产精品无码永久免费888| 五月天国产精品| 成人av在线一区二区三区| 欧美大胆一级视频| 国产二区国产一区在线观看| 色狠狠综合天天综合综合| 久久久久久久一区| 男女男精品视频| 91福利视频在线| 国产精品久久久久影院| 麻豆免费看一区二区三区| 在线亚洲精品福利网址导航| 亚洲国产精品黑人久久久 | 国产麻豆精品一区二区| 欧美精品tushy高清| 一区二区三区四区不卡在线| 国产成a人亚洲精品| 久久综合给合久久狠狠狠97色69| 三级亚洲高清视频| 欧美性一级生活| 亚洲另类春色校园小说| a4yy欧美一区二区三区| 国产精品入口麻豆九色| 国产成人免费av在线| 久久尤物电影视频在线观看| 欧美aaa在线| 欧美精三区欧美精三区| 午夜电影一区二区三区| 欧美日韩免费一区二区三区| 亚洲韩国一区二区三区| 精品1区2区3区| 亚洲国产一区二区三区青草影视| 在线观看91精品国产入口| 樱花影视一区二区| 欧美午夜精品一区二区蜜桃 | 亚洲一二三区视频在线观看| 99re热这里只有精品免费视频| 国产欧美综合在线| 成人性生交大片免费看视频在线 | 色婷婷av一区二区三区软件| 中文字幕视频一区| 91免费小视频| 亚洲午夜电影在线| 欧美酷刑日本凌虐凌虐| 美腿丝袜亚洲三区| 久久亚洲一区二区三区明星换脸 | 国产精品一区在线| 久久久不卡影院| 成人黄色777网| 亚洲免费成人av| 国产精品久久三| 97久久超碰国产精品电影| 亚洲人成精品久久久久久 | 欧美一区二区久久久| 日韩精品电影在线观看| 精品久久久久久综合日本欧美| 国产成人免费视频一区| 成人免费小视频| 51精品国自产在线| 精品在线你懂的| 成人免费小视频| 91精品国产丝袜白色高跟鞋| 国产原创一区二区三区| 国产精品毛片无遮挡高清| 欧美自拍丝袜亚洲| 精品在线你懂的| 亚洲欧美日韩久久| 日韩欧美一级片| 99久久精品久久久久久清纯| 亚洲bt欧美bt精品| 中文字幕乱码久久午夜不卡 | 久久免费美女视频|