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

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

?? bigd.h

?? RSA operation library.
?? H
字號:
/* $Id: bigd.h $ */

/******************** SHORT COPYRIGHT NOTICE**************************
This source code is part of the BigDigits multiple-precision
arithmetic library Version 2.1 originally written by David Ireland,
copyright (c) 2001-6 D.I. Management Services Pty Limited, all rights
reserved. It is provided "as is" with no warranties. You may use
this software under the terms of the full copyright notice
"bigdigitsCopyright.txt" that should have been included with this
library or can be obtained from <www.di-mgt.com.au/bigdigits.html>.
This notice must always be retained in any copy.
******************* END OF COPYRIGHT NOTICE***************************/
/*
	Last updated:
	$Date: 2006-08-23 11:13:00 $
	$Revision: 2.1.0 $
	$Author: dai $
*/

/* 
Interface to the BIGD library (BigDigits "bd" functions)
Multiple-precision arithmetic for non-negative numbers
using memory management and opaque pointers. 
*/

#ifndef BIGD_H_
#define BIGD_H_ 1

#include <stddef.h>

/**** USER CONFIGURABLE SECTION ****/

/* [v2.1] Changed to use exact width integer types.
   CAUTION: change this, change bigdigits.h to match.
*/
#ifndef HAVE_C99INCLUDES
	#if (__STDC_VERSION >= 199901L) || defined(linux) || defined(__linux__)
	#define HAVE_C99INCLUDES
	#endif
#endif
#ifndef HAVE_SYS_TYPES
	#if defined(unix) || defined(__unix__)
	#define HAVE_SYS_TYPES
	#endif
#endif
#ifdef HAVE_C99INCLUDES
	#include <stdint.h>
#elif defined(HAVE_SYS_TYPES)
	#include <sys/types.h>
#else 
	#define uint32_t unsigned long 
	#define uint16_t unsigned short 
#endif

/* DIGIT_T type is not exposed by this library so we expose 
   a synonym `bdigit_t' for a single digit */
typedef uint32_t bdigit_t;

/* Macros for format specifiers 
-- change these to "u", "x" and "X" if necessary */
#ifdef HAVE_C99INCLUDES
	#include <inttypes.h>
#else 
	#define PRIu32 "lu" 
	#define PRIx32 "lx" 
	#define PRIX32 "lX" 
#endif
/* We define our own based on the C99 standard ones */
#define PRIuBIGD PRIu32
#define PRIxBIGD PRIx32
#define PRIXBIGD PRIX32

/**** END OF USER CONFIGURABLE SECTION ****/

#define OCTETS_PER_DIGIT (sizeof(bdigit_t))
/* Options for bdPrint */
#define BD_PRINT_NL   0x1	/* append a newline after printing */
#define BD_PRINT_TRIM 0x2	/* trim leading zero digits */

/*
This interface uses opaque pointers of type BIGD using
the conventions in "C Interfaces and Implementions" by
David R. Hanson, Addison-Wesley, 1996, pp21-4.
Thanks to Ian Tree for the C++ fudge.
*/
#define T BIGD
#ifdef __cplusplus
	typedef struct T2 *T;
#else
	typedef struct T *T;
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* PROGRAMMER'S NOTES
Where the function computes a new BIGD value,
the result is returned in the first argument.
Some functions do not allow variables to overlap (noted by w#v).
Functions of type int generally return 0 to denote success 
but some return True/False (1/0) or borrow (+1) or error (-1).
Functions of type size_t (an unsigned int) return a length.

Memory is allocated if the function might need it. 
It is only released when freed with bdFree(), e.g.:

	BIGD b;
	b = bdNew();
	...
	bdFree(&b);
*/

/******************************/
/* CONSTRUCTOR AND DESTRUCTOR */
/******************************/

void pr_msg(char *msg, BIGD b);

BIGD bdNew(void);
	/* Return handle to new BIGD object */

void bdFree(BIGD *bd);	
	/* Zeroise and free BIGD memory
	   - NB pass a pointer to the handle */

/*************************/
/* ARITHMETIC OPERATIONS */
/*************************/

int bdAdd(BIGD w, BIGD u, BIGD v);
	/* Compute w = u + v, w#v */

int bdSubtract(BIGD w, BIGD u, BIGD v);
	/* Compute w = u - v, return borrow, w#v */

int bdMultiply(BIGD w, BIGD u, BIGD v);
	/* Compute w = u * v, w#u */

int bdDivide(BIGD q, BIGD r, BIGD u, BIGD v);
	/* Computes quotient q = u / v and remainder r = u mod v 
	   Trashes q and r first. q#(u,v), r#(u,v) */

int bdModulo(BIGD r, BIGD u, BIGD v);
	/* Computes r = u mod v, r#u */

int bdSquare(BIGD w, BIGD x);
	/* Computes w = x^2, w#x */

int bdIncrement(BIGD a);
	/* Sets a = a + 1, returns carry */

int bdDecrement(BIGD a);
	/* Sets a = a - 1, returns borrow */

/* 'Safe' versions with no restrictions on overlap */
int bdAddEx(BIGD w, BIGD u, BIGD v);
int bdSubtractEx(BIGD w, BIGD u, BIGD v);
int bdMultiplyEx(BIGD w, BIGD u, BIGD v);
int bdDivideEx(BIGD q, BIGD r, BIGD u, BIGD v);
int bdModuloEx(BIGD r, BIGD u, BIGD v);
int bdSquareEx(BIGD w, BIGD x);

/* [v2.1.0] new function */
int bdSqrt(BIGD s, BIGD x);
	/* Computes integer square root s = floor(sqrt(x)) */

/*************************/
/* COMPARISON OPERATIONS */
/*************************/

int bdIsEqual(BIGD a, BIGD b);
	/* Returns true if a == b, else false */

int bdCompare(BIGD a, BIGD b);
	/* Returns sign of (a-b) */

int bdIsZero(BIGD a);
	/* Returns true if a == 0, else false */

int bdIsEven(BIGD a);
int bdIsOdd(BIGD a);
	/* Return TRUE or FALSE */

/*************************/
/* ASSIGNMENT OPERATIONS */
/*************************/

int bdSetEqual(BIGD a, BIGD b);
	/* Sets a = b */

int bdSetZero(BIGD a);
	/* Sets a = 0 */

/****************************/
/* NUMBER THEORY OPERATIONS */
/****************************/

int bdModExp(BIGD y, BIGD x, BIGD e, BIGD m);
	/* Compute y = x^e mod m */

int bdModMult(BIGD a, BIGD x, BIGD y, BIGD m);
	/* Compute a = (x * y) mod m */

int bdModInv(BIGD x, BIGD a, BIGD m);
	/* Compute x = a^-1 mod m */

int bdGcd(BIGD g, BIGD x, BIGD y);
	/* Compute g = gcd(x, y) */

int bdIsPrime(BIGD b, size_t ntests);
	/* Returns true if passes ntests x Miller-Rabin tests with trial division */

int bdRabinMiller(BIGD b, size_t ntests);
	/* Returns true if passes ntests x Miller-Rabin tests without trial division, b > 2 */

/**********************************************/
/* FUNCTIONS THAT OPERATE WITH A SINGLE DIGIT */
/**********************************************/

int bdSetShort(BIGD b, bdigit_t d);
	/* Converts single digit d into a BIGD b */

int bdShortAdd(BIGD w, BIGD u, bdigit_t d);
	/* Compute w = u + d */

int bdShortSub(BIGD w, BIGD u, bdigit_t d);
	/* Compute w = u - d, return borrow */

int bdShortMult(BIGD w, BIGD u, bdigit_t d);
	/* Compute w = u * d */

int bdShortDiv(BIGD q, BIGD r, BIGD u, bdigit_t d);
	/* Computes quotient q = u / d and remainder r = u mod d */

bdigit_t bdShortMod(BIGD r, BIGD u, bdigit_t d);
	/* Computes r = u mod d. Returns r. */

int bdShortCmp(BIGD a, bdigit_t d);
	/* Returns sign of (a-d) */

/***********************/
/* BIT-WISE OPERATIONS */
/***********************/

size_t bdBitLength(BIGD bd);
	/* Returns number of significant bits in bd */

int bdSetBit(BIGD a, size_t n, int value);
	/* Set bit n (0..nbits-1) with value 1 or 0 */

int bdGetBit(BIGD a, size_t ibit);
	/* Returns value 1 or 0 of bit n (0..nbits-1) */

/* [v2.1.0] Removed restriction on shift size */
void bdShiftLeft(BIGD a, BIGD b, size_t n);
	/* Computes a = b << n */

void bdShiftRight(BIGD a, BIGD b, size_t n);
	/* Computes a = b >> n */

/* [v2.1.0] Added ModPowerOf2, Xor, Or and And functions */
void bdModPowerOf2(BIGD a, size_t L);
	/* Computes a = a mod 2^L */

void bdXorBits(BIGD a, BIGD b, BIGD c);
	/* Computes bitwise operation a = b XOR c */

void bdOrBits(BIGD a, BIGD b, BIGD c);
	/* Computes bitwise operation a = b OR c */

void bdAndBits(BIGD a, BIGD b, BIGD c);
	/* Computes bitwise operation a = b AND c */

/*******************/
/* MISC OPERATIONS */
/*******************/

size_t bdSizeof(BIGD b);
	/* Returns number of significant digits in b */

void bdPrint(BIGD bd, size_t flags);
	/* Print bd to stdout (see flags above) */

/***************/
/* CONVERSIONS */
/***************/
/* [v2.1] Tightened up specs here */

/* All bdConv functions return 0 on error */

/* `Octet' = an 8-bit byte */

size_t bdConvFromOctets(BIGD b, const unsigned char *octets, size_t nbytes);
	/* Converts nbytes octets into big digit b, resizing b if necessary.
	   Returns actual number of digits set, which may be larger than mpSizeof(b). */

size_t bdConvToOctets(BIGD b, unsigned char *octets, size_t nbytes);
	/* Convert big digit b into array of octets, in big-endian order,
	   padding on the left with zeroes to nbytes, or truncating as necessary.
       It returns the exact number of significant bytes <nsig> in the result.
	   If octets is NULL or nbytes == 0 then just return required <nsig>;
       if nbytes== nsig, octets <-    nnnnnn;
       if nbytes > nsig, octets <- 000nnnnnn;
       if nbytes < nsig, octets <-       nnn. */

/* For Hex and Decimal conversions:
   The parameter `smax' in the bdConvFrom functions
   is the size INCLUDING the terminating zero (as in sizeof(s))
   but the bdConvTo functions return the number of characters required
   EXCLUDING the terminating zero.

   The bdConvToHex and bdConvToDecimal functions return the 
   total length of the string they tried to create even if 
   the output string was truncated at a shorter length.
*/

size_t bdConvFromHex(BIGD b, const char *s);
	/* Convert string s of hex chars into big digit b. 
	   Returns number of significant digits actually set, which could be 0. */

size_t bdConvToHex(BIGD b, char *s, size_t smax);
	/* Convert big digit b into string s of hex characters
	   where s has size smax including the terminating zero.
	   Returns number of chars required for s excluding leading zeroes. 
	   If s is NULL or smax == 0 then just return required size. */

size_t bdConvFromDecimal(BIGD b, const char *s);
	/* Convert string s of decimal chars into big digit b. 
	   Returns number of significant digits actually set, which could be 0. */

size_t bdConvToDecimal(BIGD b, char *s, size_t smax);
	/* Convert big digit b into string s of decimal characters
	   where s has size smax including the terminating zero.
	   Returns number of chars required for s excluding leading zeroes. 
	   If s is NULL or smax == 0 then just return required size. */


/****************************/
/* RANDOM NUMBER OPERATIONS */
/****************************/

/* [Version 2.1: bdRandDigit and bdRandomBits moved to bigdRand.h] */

size_t bdSetRandTest(BIGD a, size_t ndigits);
	/* Fill a with [1,ndigits] pseudo-random digits. Returns # digits set.
	   Randomly clears a random number of bits in the most significant digit.
	   For testing only. Not thread safe. */

/* TYPEDEF for user-defined random byte generator function */
typedef int (* BD_RANDFUNC)(unsigned char *buf, size_t nbytes, const unsigned char *seed, size_t seedlen);

int bdRandomSeeded(BIGD a, size_t nbits, const unsigned char *seed, 
	size_t seedlen, BD_RANDFUNC RandFunc);
	/* Generate a random number nbits long using RandFunc */

int bdGeneratePrime(BIGD b, size_t nbits, size_t ntests, const unsigned char *seed, 
	size_t seedlen, BD_RANDFUNC RandFunc);
	/* Generate a prime number nbits long; carry out ntests x primality tests */


/****************/
/* VERSION INFO */
/****************/
/* [v2.0.2] added bdVersion */

int bdVersion(void);
	/* Returns version number = major*1000+minor*100+release*10+uses_asm(0|1) */


#undef T /* (for opaque BIGD pointer) */

#ifdef __cplusplus
}
#endif

#endif /* BIGD_H_ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产va精品久久久不卡综合| 亚洲国产一区视频| 粉嫩av一区二区三区在线播放 | 久久精品99国产精品日本| 26uuu亚洲| 日本系列欧美系列| 亚洲人成网站影音先锋播放| 欧美精品第一页| 韩国精品久久久| 国产精品第一页第二页第三页| 九九九精品视频| 18成人在线观看| 激情五月激情综合网| 日韩一区二区三区电影在线观看| 日韩精品每日更新| 中文字幕乱码久久午夜不卡| 91国偷自产一区二区三区成为亚洲经典 | 午夜欧美一区二区三区在线播放| 色综合色狠狠天天综合色| 国产日韩欧美不卡| 欧美色视频在线| 奇米精品一区二区三区四区| 亚洲免费看黄网站| 91黄色免费看| 成人中文字幕电影| 日本成人中文字幕在线视频| 亚洲人123区| 日韩一级黄色片| 欧美午夜片在线观看| 国产福利91精品一区二区三区| 久久久精品综合| 欧美麻豆精品久久久久久| 不卡的av在线| 国产一区二区美女| 日本欧美大码aⅴ在线播放| 亚洲欧洲国产专区| 国产午夜久久久久| 欧美成人性战久久| 91精品国产一区二区三区香蕉| 天天操天天综合网| 亚洲精品视频在线看| 国产欧美一区二区精品仙草咪 | 精品一区中文字幕| 五月天亚洲精品| 亚洲影视在线播放| 首页国产丝袜综合| 国产精品水嫩水嫩| 日韩理论片网站| 玉足女爽爽91| 香港成人在线视频| 五月天亚洲精品| 精品一区二区三区免费播放| 国产一区欧美一区| 成人性生交大片免费看中文网站| 天堂久久一区二区三区| 日韩精品免费专区| 麻豆一区二区99久久久久| 国产在线精品视频| caoporm超碰国产精品| 久久不见久久见免费视频1| 国内精品久久久久影院色| 性久久久久久久| 久久国产夜色精品鲁鲁99| 国产精品综合二区| 91丨porny丨中文| 欧美精品久久久久久久多人混战| 国产盗摄一区二区三区| 美女网站色91| 国产suv一区二区三区88区| 久久99精品国产91久久来源| 国产成人午夜精品影院观看视频 | 成人动漫一区二区| 99久久伊人精品| 国产成人午夜精品影院观看视频| 日韩av不卡在线观看| 国产麻豆视频一区| 91香蕉视频在线| 日韩一级免费观看| 亚洲三级电影网站| 免费看欧美女人艹b| 午夜精品久久久久久久蜜桃app| 一区二区三区影院| 久久电影网站中文字幕 | 国产欧美精品区一区二区三区 | 国内外精品视频| 奇米精品一区二区三区在线观看| 亚洲成人午夜电影| 亚洲福利一区二区| 懂色av一区二区三区蜜臀| 国产乱对白刺激视频不卡| 在线免费观看日本欧美| 欧美成人官网二区| 欧美精品一区二区三区蜜桃视频| 日韩一区二区三区四区| 国产精品美女www爽爽爽| 日韩电影在线观看电影| 93久久精品日日躁夜夜躁欧美| 北条麻妃国产九九精品视频| 91精品欧美福利在线观看| 亚洲欧洲日韩一区二区三区| 青青草97国产精品免费观看| 色网站国产精品| 国产色综合久久| 蜜乳av一区二区| 欧美性受极品xxxx喷水| 国产女主播一区| 日本一区二区三区国色天香| 麻豆精品国产传媒mv男同| 欧美亚洲丝袜传媒另类| 亚洲欧洲另类国产综合| 丰满亚洲少妇av| 91蜜桃在线观看| 久久一留热品黄| 奇米一区二区三区| 丰满白嫩尤物一区二区| 91看片淫黄大片一级在线观看| 欧美色大人视频| 中文字幕中文在线不卡住| 国内精品久久久久影院薰衣草| 韩国成人在线视频| 欧美岛国在线观看| 日韩电影在线观看一区| 欧美日韩国产123区| 亚洲午夜国产一区99re久久| 91蜜桃在线观看| 亚洲乱码国产乱码精品精小说| 亚洲1区2区3区视频| 色婷婷av一区二区三区gif| 国产精品久久久久影院亚瑟| 国产寡妇亲子伦一区二区| 久久久天堂av| 国产在线观看一区二区| 久久久美女毛片| 九九在线精品视频| 精品国一区二区三区| 国内不卡的二区三区中文字幕| a级高清视频欧美日韩| 国产精品理论在线观看| 不卡电影一区二区三区| 亚洲欧美日韩国产中文在线| 色猫猫国产区一区二在线视频| 欧美大胆一级视频| 国产在线播精品第三| 欧美经典一区二区| 99精品国产热久久91蜜凸| 亚洲欧美日韩中文字幕一区二区三区 | 国产欧美日韩综合精品一区二区 | 亚洲va天堂va国产va久| 欧美日韩激情在线| 青青草国产精品亚洲专区无| 日韩欧美一区电影| 国产精品1区2区| 国产精品二三区| 久久91精品国产91久久小草| 精品国产一区二区三区久久影院 | 菠萝蜜视频在线观看一区| 国产精品剧情在线亚洲| 色婷婷综合中文久久一本| 亚洲一区二区在线播放相泽| 3atv一区二区三区| 亚洲一区二区三区在线| 欧美日韩激情一区二区三区| 蜜桃一区二区三区四区| 欧美日韩另类国产亚洲欧美一级| 国产精品乱码妇女bbbb| 在线观看成人小视频| 视频一区在线视频| 国产日韩v精品一区二区| 色综合久久99| 国产精品丝袜黑色高跟| 欧美日韩在线一区二区| 亚洲乱码国产乱码精品精98午夜| 成人免费视频网站在线观看| 亚洲欧美日本韩国| 日韩免费成人网| 色综合久久综合| 美女视频一区在线观看| 国产精品久久国产精麻豆99网站| 国产超碰在线一区| 性久久久久久久久久久久| 欧美国产在线观看| 国产福利一区在线| 国产欧美一区二区精品仙草咪| 国产传媒久久文化传媒| 亚洲综合成人在线视频| 久久久国产一区二区三区四区小说| 国内精品伊人久久久久av一坑 | 欧美成人在线直播| bt欧美亚洲午夜电影天堂| 日韩精品1区2区3区| 欧美一区二区三区喷汁尤物| 成人激情小说乱人伦| 国产精品亲子伦对白| 不卡在线观看av| 久久国产精品色婷婷| 亚洲电影第三页| 亚洲欧洲精品成人久久奇米网| 色av综合在线| 粉嫩欧美一区二区三区高清影视 | 狠狠v欧美v日韩v亚洲ⅴ|