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

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

?? mpi.c

?? PeerSec Networks MatrixSSL?is an embedded SSL implementation designed for small footprint applicatio
?? C
?? 第 1 頁 / 共 5 頁
字號:
		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 int32		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;/*		Now 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;}/******************************************************************************//*	High level addition (handles signs) */int32 mp_add (mp_int * a, mp_int * b, mp_int * c){	int32		sa, sb, res;/*	Get sign of both inputs */	sa = a->sign;	sb = b->sign;/*	Handle two cases, not four. */	if (sa == sb) {/*		Both positive or both negative. Add their magnitudes, copy the sign. */		c->sign = sa;		res = s_mp_add (a, b, c);	} else {/*		One positive, the other negative.  Subtract the one with the greater		magnitude from the one of the lesser magnitude.  The result gets the sign of		the one with the greater magnitude. */		if (mp_cmp_mag (a, b) == MP_LT) {			c->sign = sb;			res = s_mp_sub (b, a, c);		} else {			c->sign = sa;			res = s_mp_sub (a, b, c);		}	}	return res;}/******************************************************************************//*	Compare a digit. */int32 mp_cmp_d (mp_int * a, mp_digit b){/*	Compare based on sign */	if (a->sign == MP_NEG) {		return MP_LT;	}/*	Compare based on magnitude */	if (a->used > 1) {		return MP_GT;	}/*	Compare the only digit of a to b */	if (a->dp[0] > b) {		return MP_GT;	} else if (a->dp[0] < b) {		return MP_LT;	} else {		return MP_EQ;	}}/******************************************************************************//*	b = a/2 */int32 mp_div_2 (mp_int * a, mp_int * b){	int32		x, res, oldused;/*	Copy */	if (b->alloc < a->used) {		if ((res = mp_grow (b, a->used)) != MP_OKAY) {			return res;		}	}	oldused = b->used;	b->used = a->used;	{		register mp_digit r, rr, *tmpa, *tmpb;/*		Source alias */		tmpa = a->dp + b->used - 1;/*		dest alias */		tmpb = b->dp + b->used - 1;/*		carry */		r = 0;		for (x = b->used - 1; x >= 0; x--) {/*			Get the carry for the next iteration */			rr = *tmpa & 1;/*						Shift the current digit, add in carry and store */			*tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1));/*			Forward carry to next iteration */			r = rr;		}/* 		Zero excess digits */		tmpb = b->dp + b->used;		for (x = b->used; x < oldused; x++) {			*tmpb++ = 0;		}	}	b->sign = a->sign;	mp_clamp (b);	return MP_OKAY;}/******************************************************************************//*	Computes xR**-1 == x (mod N) via Montgomery Reduction */#ifdef USE_SMALL_WORDint32 mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho){	int32			ix, res, digs;	mp_digit	mu;/*	Can the fast reduction [comba] method be used?	Note that unlike in mul you're safely allowed *less* than the available	columns [255 per default] since carries are fixed up in the inner loop. */	digs = n->used * 2 + 1;	if ((digs < MP_WARRAY) && 		n->used < 		(1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {			return fast_mp_montgomery_reduce (x, n, rho);		}/*		Grow the input as required. */		if (x->alloc < digs) {			if ((res = mp_grow (x, digs)) != MP_OKAY) {				return res;			}		}		x->used = digs;		for (ix = 0; ix < n->used; ix++) {/*			mu = ai * rho mod b			The value of rho must be precalculated via mp_montgomery_setup()			such that it equals -1/n0 mod b this allows the following inner			loop to reduce the input one digit at a time */			mu = (mp_digit)(((mp_word)x->dp[ix]) * ((mp_word)rho) & MP_MASK);			/* a = a + mu * m * b**i */			{				register int32 iy;				register mp_digit *tmpn, *tmpx, u;				register mp_word r;/*				alias for digits of the modulus */				tmpn = n->dp;/*				alias for the digits of x [the input] */				tmpx = x->dp + ix;/*				set the carry to zero */				u = 0;/*				Multiply and add in place */				for (iy = 0; iy < n->used; iy++) {					/* compute product and sum */					r = ((mp_word)mu) * ((mp_word)*tmpn++) +						((mp_word) u) + ((mp_word) * tmpx);					/* get carry */					u = (mp_digit)(r >> ((mp_word) DIGIT_BIT));					/* fix digit */					*tmpx++ = (mp_digit)(r & ((mp_word) MP_MASK));				}				/* At this point the ix'th digit of x should be zero *//*				propagate carries upwards as required */				while (u) {					*tmpx		+= u;					u			= *tmpx >> DIGIT_BIT;					*tmpx++ &= MP_MASK;				}			}		}/*		At this point the n.used'th least significant digits of x are all zero		which means we can shift x to the right by n.used digits and the 		residue is unchanged.*/		/* x = x/b**n.used */		mp_clamp(x);		mp_rshd (x, n->used);		/* if x >= n then x = x - n */		if (mp_cmp_mag (x, n) != MP_LT) {			return s_mp_sub (x, n, x);		}		return MP_OKAY;}#endif /* USE_SMALL_WORD *//******************************************************************************//*	Setups the montgomery reduction stuff. */int32 mp_montgomery_setup (mp_int * n, mp_digit * rho){	mp_digit x, b;/*	fast inversion mod 2**k		Based on the fact that		XA = 1 (mod 2**n)	=>  (X(2-XA)) A		= 1 (mod 2**2n)						=>  2*X*A - X*X*A*A	= 1						=>  2*(1) - (1)		= 1*/	b = n->dp[0];	if ((b & 1) == 0) {		return MP_VAL;	}	x = (((b + 2) & 4) << 1) + b;		/* here x*a==1 mod 2**4 */	x = (x * (2 - b * x)) & MP_MASK;	/* here x*a==1 mod 2**8 */#if !defined(MP_8BIT)	x = (x * (2 - b * x)) & MP_MASK;	/* here x*a==1 mod 2**8 */#endif /* MP_8BIT */#if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT))	x *= 2 - b * x;						/* here x*a==1 mod 2**32 */#endif#ifdef MP_64BIT	x *= 2 - b * x;						/* here x*a==1 mod 2**64 */#endif /* MP_64BIT */	/* rho = -1/m mod b */	*rho = (((mp_word) 1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;	return MP_OKAY;}/******************************************************************************//*	High level subtraction (handles signs) */int32 mp_sub (mp_int * a, mp_int * b, mp_int * c){	int32		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;}/******************************************************************************//*	calc a value mod 2**b */int32 mp_mod_2d (mp_int * a, int32 b, mp_int * c){	int32		x, res;/*	if b is <= 0 then zero the int32 */	if (b <= 0) {		mp_zero (c);		return MP_OKAY;	}/*	If the modulus is larger than the value than return */	if (b >=(int32) (a->used * DIGIT_BIT)) {		res = mp_copy (a, c);		return res;	}	/* copy */	if ((res = mp_copy (a, c)) != MP_OKAY) {		return res;	}/*	Zero digits above the last digit of the modulus */	for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {		c->dp[x] = 0;	}/*	Clear the digit that is not completely outside/inside the modulus */	c->dp[b / DIGIT_BIT] &=		(mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1));	mp_clamp (c);	return MP_OKAY;}/******************************************************************************//*	Shift right a certain amount of digits. */void mp_rshd (mp_int * a, int32 b){	int32		x;/*	If b <= 0 then ignore it */	if (b <= 0) {		return;	}/*	If b > used then simply zero it and return.*/	if (a->used <= b) {		mp_zero (a);		return;	}	{		register mp_digit *bottom, *top;/*		Shift the digits down */		/* bottom */		bottom = a->dp;		/* top [offset into digits] */		top = a->dp + b;/*		This is implemented as a sliding window where the window is b-digits long		and digits from the top of the window are copied to the bottom.				 e.g.		b-2 | b-1 | b0 | b1 | b2 | ... | bb |   ---->		/\                   |      ---->		\-------------------/      ----> */		for (x = 0; x < (a->used - b); x++) {			*bottom++ = *top++;		}/*		Zero the top digits */		for (; x < a->used; x++) {			*bottom++ = 0;		}	}/*	Remove excess digits */	a->used -= b;}/******************************************************************************//* 	Low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */int32 s_mp_sub (mp_int * a, mp_int * b, mp_int * c){	int32		olduse, res, min, max;/*	Find sizes */	min = b->used;	max = a->used;/*	init result */	if (c->alloc < max) {		if ((res = mp_grow (c, max)) != MP_OKAY) {			return res;		}	}	olduse = c->used;	c->used = max;	{		register mp_digit u, *tmpa, *tmpb, *tmpc;		register int32 i;/*		alias for digit pointers */		tmpa = a->dp;		tmpb = b->dp;		tmpc = c->dp;/*		set carry to zero */		u = 0;		for (i = 0; i < min; i++) {			/* T[i] = A[i] - B[i] - U */			*tmpc = *tmpa++ - *tmpb++ - u;/*			U = carry bit of T[i]			Note this saves performing an AND operation since if a carry does occur it			will propagate all the way to the MSB.  As a result a single shift			is enough to get the carry */			u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1));			/* Clear carry from T[i] */			*tmpc++ &= MP_MASK;		}/*		Now copy higher words if any, e.g. if A has more digits than B */		for (; i < max; i++) {			/* T[i] = A[i] - U */			*tmpc = *tmpa++ - u;			/* U = carry bit of T[i] */			u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1));			/* Clear carry from T[i] */			*tmpc++ &= MP_MASK;		}/*		Clear digits above used (since we may not have grown result above) */		for (i = c->used; i < olduse; i++) {			*tmpc++ = 0;		}	}	mp_clamp (c);	return MP_OKAY;}/******************************************************************************//*	integer signed division. 	c*b + d == a [e.g. a/b, c=quotient, d=remainder]	HAC pp.598 Algorithm 14.20	Note that the description in HAC is horribly incomplete.  For example,	it doesn't consider the case where digits are removed from 'x' in the inner	loop.  It also doesn't consider the case that y has fewer than three

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久婷婷国产综合精品| 日韩欧美精品在线视频| 欧美日精品一区视频| 成人国产电影网| 色综合网色综合| 欧美一级片免费看| 国产精品久久久久aaaa樱花| 亚洲国产精品人人做人人爽| 另类小说色综合网站| 成人一区二区在线观看| 欧美三级在线视频| 日韩一级欧美一级| 成人欧美一区二区三区黑人麻豆| 日韩精品每日更新| 国产成人av福利| 欧美乱妇一区二区三区不卡视频| 2023国产精品自拍| 亚洲国产aⅴ成人精品无吗| 成人午夜大片免费观看| 91精品国产日韩91久久久久久| 国产精品视频免费看| 蜜桃视频第一区免费观看| 97久久精品人人爽人人爽蜜臀| 精品国产免费久久| 夜夜爽夜夜爽精品视频| 福利电影一区二区| 日韩精品资源二区在线| 亚洲欧洲综合另类| 国产精品正在播放| 精品久久久久久久久久久久久久久久久 | 久久一日本道色综合| 亚洲成人午夜电影| 成人h动漫精品| 精品久久久三级丝袜| 石原莉奈一区二区三区在线观看| 97久久精品人人做人人爽50路 | 精品在线免费观看| 欧美日韩在线三级| 国产精品视频一区二区三区不卡| 久久99国产精品成人| 欧美高清性hdvideosex| 亚洲图片自拍偷拍| 日本精品一区二区三区四区的功能| 国产日韩欧美激情| 日本中文在线一区| 欧美影院午夜播放| 亚洲一区二区三区视频在线播放| 国产综合色视频| 精品国产乱码久久久久久老虎| 免费视频一区二区| 中文字幕精品在线不卡| 色综合天天综合网天天看片| 亚洲一区二区三区三| 欧美一卡在线观看| 国产成人在线视频播放| 亚洲精品国产一区二区三区四区在线 | 国产精品性做久久久久久| 欧美经典一区二区三区| 色系网站成人免费| 毛片一区二区三区| 国产精品你懂的| 欧美日韩一区精品| 国产激情一区二区三区| 亚洲午夜视频在线观看| 精品成a人在线观看| 一本大道久久精品懂色aⅴ| 日韩精品一级二级| 国产精品无遮挡| 欧美高清视频一二三区| 顶级嫩模精品视频在线看| 亚洲一区二区三区小说| 国产欧美日韩综合精品一区二区| 欧美综合视频在线观看| 精品一区二区免费| 一区二区三区国产精品| 国产三级精品三级在线专区| 91在线视频观看| 国内精品伊人久久久久av一坑| 一区二区三区中文免费| 日韩欧美第一区| 91高清视频在线| 国产精品中文字幕日韩精品| 五月婷婷色综合| 亚洲欧洲av在线| 国产三级三级三级精品8ⅰ区| 欧美日韩一区高清| 色噜噜狠狠成人中文综合| 国产一区欧美一区| 麻豆视频观看网址久久| 亚洲国产视频一区| 中文字幕一区二区三区四区不卡 | 国产精品人人做人人爽人人添| 91麻豆精品国产91久久久久久久久 | 精品国产91九色蝌蚪| 欧美日韩成人综合| 91美女在线观看| 国产v日产∨综合v精品视频| 日韩高清欧美激情| 亚洲mv在线观看| 亚洲一区二区三区不卡国产欧美| 亚洲欧洲精品天堂一级| 国产精品私人自拍| 国产日韩欧美不卡| 欧美国产一区二区在线观看 | 8x福利精品第一导航| 91国产精品成人| 在线免费av一区| 在线日韩一区二区| 91福利资源站| 欧美在线短视频| 欧美日韩亚洲综合| 欧美一区二区三区在线视频| 欧美色成人综合| 欧美性感一区二区三区| 欧美少妇xxx| 欧美电影在线免费观看| 欧美人与性动xxxx| 日韩一区二区免费电影| 日韩欧美中文字幕一区| wwwwww.欧美系列| 国产欧美日产一区| 中文字幕一区二区在线观看| 亚洲男女毛片无遮挡| 一区二区在线观看免费| 夜夜精品视频一区二区| 亚洲国产综合色| 日韩电影网1区2区| 国产精品一区二区无线| 成人激情动漫在线观看| 日本韩国欧美三级| 欧美精品日日鲁夜夜添| 欧美zozozo| 久久久www成人免费无遮挡大片| 久久久久国产精品麻豆| 国产精品第四页| 亚洲国产日韩综合久久精品| 免费视频一区二区| 国产成人精品午夜视频免费| 一本在线高清不卡dvd| 欧美日韩极品在线观看一区| 精品日韩一区二区三区免费视频| 久久久久久久电影| 亚洲精品日韩一| 无码av免费一区二区三区试看| 久久精品国产色蜜蜜麻豆| 高清不卡一二三区| 欧美日韩国产综合视频在线观看| 日韩欧美另类在线| 国产精品亲子乱子伦xxxx裸| 夜夜嗨av一区二区三区四季av| 久久精品国产999大香线蕉| 成人午夜激情片| 欧美男生操女生| 亚洲国产激情av| 日韩精品1区2区3区| 国产精品一区二区视频| 欧美日韩久久久一区| 久久久亚洲欧洲日产国码αv| 亚洲女与黑人做爰| 国产一二三精品| 欧美视频在线播放| 国产精品久久久久一区| 精品一区二区综合| 一本久道中文字幕精品亚洲嫩| 久久久久久久久久电影| 亚洲成人一区在线| 99r国产精品| 国产日本欧洲亚洲| 麻豆精品视频在线观看免费| 色婷婷av一区二区三区软件| 久久人人爽爽爽人久久久| 亚洲高清不卡在线观看| 99视频在线精品| 欧美激情综合五月色丁香小说| 蜜臀av在线播放一区二区三区 | 中文字幕永久在线不卡| 狠狠色丁香婷婷综合| 欧美男同性恋视频网站| 一区二区三区在线播放| 不卡的av电影| 国产校园另类小说区| 国产一区在线精品| 日韩免费看的电影| 日韩二区在线观看| 欧美日韩国产高清一区| 亚洲一区二三区| 91国产丝袜在线播放| 亚洲久草在线视频| 91在线看国产| 亚洲欧美日韩国产中文在线| 成人激情午夜影院| 中文字幕国产一区| 国产夫妻精品视频| 中文字幕第一区二区| 成人丝袜视频网| 国产精品青草久久| 一本大道久久a久久综合婷婷| 中文字幕一区二区在线播放| 99久久久久久| 一区二区三区鲁丝不卡|