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

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

?? bignumber.cpp

?? RSA加密解密算法
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
	if ((t >> 32) == 0)
		return 0;
	while (--len) {
		if (++BIGLITTLE(*--num,*num++) != 0)
			return 0;
	}
	return 1;
}
#else /* no BNWORD64 */
BNWORD32
bniAdd1_32(BNWORD32 *num, unsigned len, BNWORD32 carry)
{
	ASSERT(len > 0);	/* Alternative: if (!len) return carry */

	if ((BIGLITTLE(*--num,*num++) += carry) >= carry)
		return 0;
	while (--len) {
		if (++BIGLITTLE(*--num,*num++) != 0)
			return 0;
	}
	return 1;
}
#endif
#endif/* !bniAdd1_32 */

/*
 * bniSub1_32: subtract the single-word "borrow" from the given number.
 * Used for minor decrements and propagating the borrow after
 * subtracting a shorter bignum.
 *
 * Technique: Similar to the add, above.  If there is a double-length type,
 * use that to generate the first borrow.
 * If not, after subtracting the first borrow, which may be > 1, compare
 * the difference and the *negative* of the carry.  If the subtract wraps
 * (causing a borrow out from the subtraction), the result will be at least
 * as large as -borrow.  If the result < -borrow, then no borrow out has
 * appeared and we may return immediately, except when borrow == 0.  To
 * deal with that case, use the identity that -x = ~x+1, and instead of
 * comparing < -borrow, compare for <= ~borrow.
 * Either way, if there is a borrow out, enter a loop decrementing words
 * until a non-zero word is reached.
 *
 * Note the cast of ~borrow to (BNWORD32).  If the size of an int is larger
 * than BNWORD32, C rules say the number is expanded for the arithmetic, so
 * the inversion will be done on an int and the value won't be quite what
 * is expected.
 */
#ifndef bniSub1_32	/* If defined, it's provided as an asm subroutine */
#ifdef BNWORD64
BNWORD32
bniSub1_32(BNWORD32 *num, unsigned len, BNWORD32 borrow)
{
	BNWORD64 t;
	ASSERT(len > 0);	/* Alternative: if (!len) return borrow */

	t = (BNWORD64)BIGLITTLE(*--num,*num) - borrow;
	BIGLITTLE(*num,*num++) = (BNWORD32)t;
	if ((t >> 32) == 0)
		return 0;
	while (--len) {
		if ((BIGLITTLE(*--num,*num++))-- != 0)
			return 0;
	}
	return 1;
}
#else /* no BNWORD64 */
BNWORD32
bniSub1_32(BNWORD32 *num, unsigned len, BNWORD32 borrow)
{
	ASSERT(len > 0);	/* Alternative: if (!len) return borrow */

	if ((BIGLITTLE(*--num,*num++) -= borrow) <= (BNWORD32)~borrow)
		return 0;
	while (--len) {
		if ((BIGLITTLE(*--num,*num++))-- != 0)
			return 0;
	}
	return 1;
}
#endif
#endif /* !bniSub1_32 */

/*
 * bniAddN_32: add two bignums of the same length,
 * returning the carry (0 or 1).
 * One of the building blocks, along with bniAdd1, of adding two bignums of
 * differing lengths.
 *
 * Technique: Maintain a word of carry.  If there is no double-width type,
 * use the same technique as in bniAdd1, above, to maintain the carry by
 * comparing the inputs.  Adding the carry sources is used as an OR operator;
 * at most one of the two comparisons can possibly be true.  The first can
 * only be true if carry == 1 and x, the result, is 0.  In that case the
 * second can't possibly be true.
 */
#ifndef bniAddN_32
#ifdef BNWORD64
BNWORD32
bniAddN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len)
{
	BNWORD64 t;

	ASSERT(len > 0);

	t = (BNWORD64)BIGLITTLE(*--num1,*num1) + BIGLITTLE(*--num2,*num2++);
	BIGLITTLE(*num1,*num1++) = (BNWORD32)t;
	while (--len) {
		t = (BNWORD64)BIGLITTLE(*--num1,*num1) +
		    (BNWORD64)BIGLITTLE(*--num2,*num2++) + (t >> 32);
		BIGLITTLE(*num1,*num1++) = (BNWORD32)t;
	}

	return (BNWORD32)(t>>32);
}
#else /* no BNWORD64 */
BNWORD32
bniAddN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len)
{
	BNWORD32 x, carry = 0;

	ASSERT(len > 0);	/* Alternative: change loop to test at start */

	do {
		x = BIGLITTLE(*--num2,*num2++);
		carry = (x += carry) < carry;
		carry += (BIGLITTLE(*--num1,*num1++) += x) < x;
	} while (--len);

	return carry;
}
#endif
#endif /* !bniAddN_32 */

/*
 * bniSubN_32: add two bignums of the same length,
 * returning the carry (0 or 1).
 * One of the building blocks, along with subn1, of subtracting two bignums of
 * differing lengths.
 *
 * Technique: If no double-width type is availble, maintain a word of borrow.
 * First, add the borrow to the subtrahend (did you have to learn all those
 * awful words in elementary school, too?), and if it overflows, set the
 * borrow again.  Then subtract the modified subtrahend from the next word
 * of input, using the same technique as in subn1, above.
 * Adding the borrows is used as an OR operator; at most one of the two
 * comparisons can possibly be true.  The first can only be true if
 * borrow == 1 and x, the result, is 0.  In that case the second can't
 * possibly be true.
 *
 * In the double-word case, (BNWORD32)-(t>>32) is subtracted, rather than
 * adding t>>32, because the shift would need to sign-extend and that's
 * not guaranteed to happen in ANSI C, even with signed types.
 */
#ifndef bniSubN_32
#ifdef BNWORD64
BNWORD32
bniSubN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len)
{
	BNWORD64 t;

	ASSERT(len > 0);

	t = (BNWORD64)BIGLITTLE(*--num1,*num1) - BIGLITTLE(*--num2,*num2++);
	BIGLITTLE(*num1,*num1++) = (BNWORD32)t;

	while (--len) {
		t = (BNWORD64)BIGLITTLE(*--num1,*num1) -
		    (BNWORD64)BIGLITTLE(*--num2,*num2++) -
		    (BNWORD32)-(t >> 32);
		BIGLITTLE(*num1,*num1++) = (BNWORD32)t;
	}

	return -(BNWORD32)(t>>32);
}
#else
BNWORD32
bniSubN_32(BNWORD32 *num1, BNWORD32 const *num2, unsigned len)
{
	BNWORD32 x, borrow = 0;

	ASSERT(len > 0);	/* Alternative: change loop to test at start */

	do {
		x = BIGLITTLE(*--num2,*num2++);
		borrow = (x += borrow) < borrow;
		borrow += (BIGLITTLE(*--num1,*num1++) -= x) > (BNWORD32)~x;
	} while (--len);

	return borrow;
}
#endif
#endif /* !bniSubN_32 */

#ifndef bniCmp_32
/*
 * bniCmp_32: compare two bignums of equal length, returning the sign of
 * num1 - num2. (-1, 0 or +1).
 * 
 * Technique: Change the little-endian pointers to big-endian pointers
 * and compare from the most-significant end until a difference if found.
 * When it is, figure out the sign of the difference and return it.
 */
int
bniCmp_32(BNWORD32 const *num1, BNWORD32 const *num2, unsigned len)
{
	BIGLITTLE(num1 -= len, num1 += len);
	BIGLITTLE(num2 -= len, num2 += len);

	while (len--) {
		if (BIGLITTLE(*num1++ != *num2++, *--num1 != *--num2)) {
			if (BIGLITTLE(num1[-1] < num2[-1], *num1 < *num2))
				return -1;
			else
				return 1;
		}
	}
	return 0;
}
#endif /* !bniCmp_32 */

/*
 * mul32_ppmmaa(ph,pl,x,y,a,b) is an optional routine that
 * computes (ph,pl) = x * y + a + b.  mul32_ppmma and mul32_ppmm
 * are simpler versions.  If you want to be lazy, all of these
 * can be defined in terms of the others, so here we create any
 * that have not been defined in terms of the ones that have been.
 */

/* Define ones with fewer a's in terms of ones with more a's */
#if !defined(mul32_ppmma) && defined(mul32_ppmmaa)
#define mul32_ppmma(ph,pl,x,y,a) mul32_ppmmaa(ph,pl,x,y,a,0)
#endif

#if !defined(mul32_ppmm) && defined(mul32_ppmma)
#define mul32_ppmm(ph,pl,x,y) mul32_ppmma(ph,pl,x,y,0)
#endif

/*
 * Use this definition to test the mul32_ppmm-based operations on machines
 * that do not provide mul32_ppmm.  Change the final "0" to a "1" to
 * enable it.
 */
#if !defined(mul32_ppmm) && defined(BNWORD64) && 0	/* Debugging */
#define mul32_ppmm(ph,pl,x,y) \
	({BNWORD64 _ = (BNWORD64)(x)*(y); (pl) = _; (ph) = _>>32;})
#endif

#if defined(mul32_ppmm) && !defined(mul32_ppmma)
#define mul32_ppmma(ph,pl,x,y,a) \
	(mul32_ppmm(ph,pl,x,y), (ph) += ((pl) += (a)) < (a))
#endif

#if defined(mul32_ppmma) && !defined(mul32_ppmmaa)
#define mul32_ppmmaa(ph,pl,x,y,a,b) \
	(mul32_ppmma(ph,pl,x,y,a), (ph) += ((pl) += (b)) < (b))
#endif

/*
 * bniMulN1_32: Multiply an n-word input by a 1-word input and store the
 * n+1-word product.  This uses either the mul32_ppmm and mul32_ppmma
 * macros, or C multiplication with the BNWORD64 type.  This uses mul32_ppmma
 * if available, assuming you won't bother defining it unless you can do
 * better than the normal multiplication.
 */
#ifndef bniMulN1_32
#ifdef bniMulAdd1_32	/* If we have this asm primitive, use it. */
void
bniMulN1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	bniZero_32(out, len);
	BIGLITTLE(*(out-len),*(out+len)) = bniMulAdd1_32(out, in, len, k);
}
#elif defined(mul32_ppmm)
void
bniMulN1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD32 prod, carry, carryin;

	ASSERT(len > 0);

	BIG(--out;--in;);
	mul32_ppmm(carry, *out, *in, k);
	LITTLE(out++;in++;)

	while (--len) {
		BIG(--out;--in;)
		carryin = carry;
		mul32_ppmma(carry, *out, *in, k, carryin);
		LITTLE(out++;in++;)
	}
	BIGLITTLE(*--out,*out) = carry;
}
#elif defined(BNWORD64)
void
bniMulN1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD64 p;

	ASSERT(len > 0);

	p = (BNWORD64)BIGLITTLE(*--in,*in++) * k;
	BIGLITTLE(*--out,*out++) = (BNWORD32)p;

	while (--len) {
		p = (BNWORD64)BIGLITTLE(*--in,*in++) * k + (BNWORD32)(p >> 32);
		BIGLITTLE(*--out,*out++) = (BNWORD32)p;
	}
	BIGLITTLE(*--out,*out) = (BNWORD32)(p >> 32);
}
#else
#error No 32x32 -> 64 multiply available for 32-bit bignum package
#endif
#endif /* bniMulN1_32 */

/*
 * bniMulAdd1_32: Multiply an n-word input by a 1-word input and add the
 * low n words of the product to the destination.  *Returns the n+1st word
 * of the product.*  (That turns out to be more convenient than adding
 * it into the destination and dealing with a possible unit carry out
 * of *that*.)  This uses either the mul32_ppmma and mul32_ppmmaa macros,
 * or C multiplication with the BNWORD64 type.
 *
 * If you're going to write assembly primitives, this is the one to
 * start with.  It is by far the most commonly called function.
 */
#ifndef bniMulAdd1_32
#if defined(mul32_ppmm)
BNWORD32
bniMulAdd1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD32 prod, carry, carryin;

	ASSERT(len > 0);

	BIG(--out;--in;);
	carryin = *out;
	mul32_ppmma(carry, *out, *in, k, carryin);
	LITTLE(out++;in++;)

	while (--len) {
		BIG(--out;--in;);
		carryin = carry;
		mul32_ppmmaa(carry, prod, *in, k, carryin, *out);
		*out = prod;
		LITTLE(out++;in++;)
	}

	return carry;
}
#elif defined(BNWORD64)
BNWORD32
bniMulAdd1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD64 p;

	ASSERT(len > 0);

	p = (BNWORD64)BIGLITTLE(*--in,*in++) * k + BIGLITTLE(*--out,*out);
	BIGLITTLE(*out,*out++) = (BNWORD32)p;

	while (--len) {
		p = (BNWORD64)BIGLITTLE(*--in,*in++) * k +
		    (BNWORD32)(p >> 32) + BIGLITTLE(*--out,*out);
		BIGLITTLE(*out,*out++) = (BNWORD32)p;
	}

	return (BNWORD32)(p >> 32);
}
#else
#error No 32x32 -> 64 multiply available for 32-bit bignum package
#endif
#endif /* bniMulAdd1_32 */

/*
 * bniMulSub1_32: Multiply an n-word input by a 1-word input and subtract the
 * n-word product from the destination.  Returns the n+1st word of the product.
 * This uses either the mul32_ppmm and mul32_ppmma macros, or
 * C multiplication with the BNWORD64 type.
 *
 * This is rather uglier than adding, but fortunately it's only used in
 * division which is not used too heavily.
 */
#ifndef bniMulSub1_32
#if defined(mul32_ppmm)
BNWORD32
bniMulSub1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD32 prod, carry, carryin;

	ASSERT(len > 0);

	BIG(--in;)
	mul32_ppmm(carry, prod, *in, k);
	LITTLE(in++;)
	carry += (BIGLITTLE(*--out,*out++) -= prod) > (BNWORD32)~prod;

	while (--len) {
		BIG(--in;);
		carryin = carry;
		mul32_ppmma(carry, prod, *in, k, carryin);
		LITTLE(in++;)
		carry += (BIGLITTLE(*--out,*out++) -= prod) > (BNWORD32)~prod;
	}

	return carry;
}
#elif defined(BNWORD64)
BNWORD32
bniMulSub1_32(BNWORD32 *out, BNWORD32 const *in, unsigned len, BNWORD32 k)
{
	BNWORD64 p;
	BNWORD32 carry, t;

	ASSERT(len > 0);

	p = (BNWORD64)BIGLITTLE(*--in,*in++) * k;
	t = BIGLITTLE(*--out,*out);
	carry = (BNWORD32)(p>>32) +
			((BIGLITTLE(*out,*out++)=t-(BNWORD32)p) > t);

	while (--len) {
		p = (BNWORD64)BIGLITTLE(*--in,*in++) * k + carry;
		t = BIGLITTLE(*--out,*out);
		carry = (BNWORD32)(p>>32) +
			( (BIGLITTLE(*out,*out++)=t-(BNWORD32)p) > t );
	}

	return carry;
}
#else
#error No 32x32 -> 64 multiply available for 32-bit bignum package
#endif
#endif /* !bniMulSub1_32 */

/*
 * Shift n words left "shift" bits.  0 < shift < 32.  Returns the
 * carry, any bits shifted off the left-hand side (0 <= carry < 2^shift).
 */
#ifndef bniLshift_32
BNWORD32
bniLshift_32(BNWORD32 *num, unsigned len, unsigned shift)
{
	BNWORD32 x, carry;

	ASSERT(shift > 0);
	ASSERT(shift < 32);

	carry = 0;
	while (len--) {
		BIG(--num;)
		x = *num;
		*num = (x<<shift) | carry;
		LITTLE(num++;)
		carry = x >> (32-shift);
	}
	return carry;
}
#endif /* !bniLshift_32 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久综合| 欧美亚洲综合网| 色欧美乱欧美15图片| 欧美一区二区精美| 亚洲色图一区二区三区| 麻豆91在线观看| 在线视频你懂得一区| 久久这里都是精品| 日韩专区中文字幕一区二区| 99久久99久久精品免费观看| 欧美一区二区三区免费观看视频 | 免费成人性网站| 99久久免费视频.com| 精品成人私密视频| 日本欧美久久久久免费播放网| 色综合激情久久| 国产精品天干天干在线综合| 精品在线观看视频| 欧美日韩一区在线| 一区二区三区高清在线| 成人激情视频网站| 久久久久久久精| 极品瑜伽女神91| 日韩一级二级三级精品视频| 亚洲电影你懂得| 91久久精品一区二区| 亚洲精品国产品国语在线app| 国产风韵犹存在线视精品| 久久久精品欧美丰满| 国产在线精品一区二区不卡了| 4438x成人网最大色成网站| 一区二区三区欧美久久| 色综合天天综合网天天狠天天| 国产精品乱码妇女bbbb| 成人伦理片在线| 国产日本一区二区| 国产成人99久久亚洲综合精品| 久久美女高清视频| 国产福利一区二区三区视频在线| 国产亚洲欧美一区在线观看| 激情综合色播激情啊| 久久综合久久99| 成人在线视频一区| 日韩伦理电影网| 日本精品视频一区二区| 夜夜嗨av一区二区三区四季av| 欧美在线一二三四区| 亚洲国产欧美另类丝袜| 91精品在线麻豆| 精品在线播放免费| 久久久精品欧美丰满| 一本久久a久久免费精品不卡| 亚洲美女视频在线| 色av一区二区| 青青国产91久久久久久 | 极品美女销魂一区二区三区| 精品播放一区二区| 成人午夜av电影| 亚洲一区二区视频| 26uuu国产电影一区二区| 丁香婷婷综合激情五月色| 亚洲人妖av一区二区| 欧美日韩精品综合在线| 国产成人一区在线| 亚洲综合色网站| 欧美一卡二卡在线| 大尺度一区二区| 日韩精品欧美成人高清一区二区| www精品美女久久久tv| 色婷婷综合久久久久中文一区二区| 午夜久久电影网| 国产三级精品视频| 欧美年轻男男videosbes| 国产福利91精品一区| 午夜精品久久久久久久久| 国产日产欧美精品一区二区三区| 欧美年轻男男videosbes| 国产成人午夜99999| 亚欧色一区w666天堂| 欧美国产综合色视频| 欧美日本免费一区二区三区| 懂色av一区二区在线播放| 午夜精品福利一区二区三区av | 蜜桃久久久久久久| 国产精品福利一区| 精品国内片67194| 欧美综合一区二区三区| 国产高清精品在线| 蜜臀av一区二区在线免费观看| 亚洲欧美偷拍三级| 欧美国产精品v| 日韩欧美美女一区二区三区| 91精品1区2区| 国产精品资源网| 精品一区二区三区香蕉蜜桃 | 综合久久久久久| 国产亚洲人成网站| 欧美岛国在线观看| 91精品国产综合久久精品图片| 色网站国产精品| 不卡av电影在线播放| 国产电影一区二区三区| 久久97超碰国产精品超碰| 亚洲电影一级片| 亚洲成人av免费| 一区二区三区**美女毛片| 国产精品丝袜91| 国产欧美视频一区二区| 精品国产三级a在线观看| 6080国产精品一区二区| 欧美色图免费看| 欧美亚洲丝袜传媒另类| 欧美影视一区二区三区| 色8久久人人97超碰香蕉987| 99国产麻豆精品| 91蜜桃视频在线| 91色在线porny| 色婷婷亚洲婷婷| 欧美色精品在线视频| 欧美久久久一区| 91.com视频| 精品国产一二三| 欧美国产乱子伦 | 欧美专区亚洲专区| 色久综合一二码| 欧美日韩国产中文| 欧美一区二区观看视频| 日韩精品一区二区三区三区免费 | 亚洲你懂的在线视频| 亚洲激情综合网| 性做久久久久久| 老司机精品视频一区二区三区| 国产一区二区免费在线| 成人av动漫网站| 色www精品视频在线观看| 欧美三电影在线| 日韩一卡二卡三卡国产欧美| 久久久久久毛片| 一区二区三区久久| 全国精品久久少妇| 国产aⅴ综合色| 94-欧美-setu| 欧美精品1区2区3区| 久久久蜜桃精品| 亚洲欧洲av另类| 日韩激情在线观看| 国产成人精品一区二区三区四区| 一本色道久久综合亚洲91| 3751色影院一区二区三区| 精品99999| 亚洲精品欧美二区三区中文字幕| 欧美aaa在线| www.欧美日韩国产在线| 欧美三级日本三级少妇99| 日韩手机在线导航| 中文字幕在线一区| 男男视频亚洲欧美| caoporn国产一区二区| 欧美绝品在线观看成人午夜影视| 久久蜜臀精品av| 亚洲国产一二三| 成人永久aaa| 精品久久人人做人人爱| 一区二区三区在线播放| 激情偷乱视频一区二区三区| 91麻豆国产精品久久| 日韩精品一区二区三区视频播放 | 国产真实乱对白精彩久久| 91网站黄www| 精品黑人一区二区三区久久 | 国产综合色视频| 在线播放91灌醉迷j高跟美女| 国产嫩草影院久久久久| 久久电影网电视剧免费观看| 欧美亚洲动漫另类| 国产精品丝袜一区| 国产激情一区二区三区桃花岛亚洲| 欧美亚一区二区| 中文字幕在线观看一区| 国产精品乡下勾搭老头1| 欧美日韩久久不卡| 一区二区三区欧美视频| 成人h动漫精品一区二| 久久精品一区二区| 久草在线在线精品观看| 91精品国产高清一区二区三区| 一级精品视频在线观看宜春院| 99久久99久久久精品齐齐| 中文字幕成人网| 国产精品资源在线看| 精品欧美一区二区久久| 男女男精品视频| 67194成人在线观看| 日韩中文字幕不卡| 欧美一区二区三区四区五区| 五月激情综合网| 欧美日韩国产经典色站一区二区三区| 亚洲欧美激情插| 欧美在线观看你懂的| 亚洲一区自拍偷拍|