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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cryrand.cal

?? 早期freebsd實現(xiàn)
?? CAL
?? 第 1 頁 / 共 5 頁
字號:
/* * cryrand - cryptographically strong pseudo-random number generator library *//* * Copyright (c) 1994 by Landon Curt Noll.  All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright, this permission notice and text * this comment, and the disclaimer below appear in all of the following: * *	supporting documentation *	source copies *	source works derived from this source *	binaries derived from this source or from derived source * * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * chongo was here	/\../\ *//* * These routines are written in the calc language.  At the time of this * notice, calc was at version 2.9.2 (We refer to calc, as in the C * program, not the Emacs subsystem). * * Calc is available by anonymous ftp from ftp.uu.net under the  * directory /pub/calc. * * If you can't get calc any other way, EMail a request to my EMail * address as shown below. * * Comments, suggestions, bug fixes and questions about these routines * are welcome.  Send EMail to the address given below. * * Happy bit twiddling, * *			Landon Curt Noll * *			chongo@toad.com *			...!{pyramid,sun,uunet}!hoptoad!chongo *//* * AN OVERVIEW OF THE FUNCTIONS: * * This calc library contains several pseudo-random number generators: * *   additive 55: * *	a55rand	  - external interface to the additive 55 generator *	sa55rand  - seed the additive 55 generator * *	This is a generator based on the additive 55 generator as *	described in Knuth's "The Art of Computer Programming - *	Seminumerical Algorithms", vol 2, 2nd edition (1981), *	Section 3.2.2, page 27, Algorithm A. * *	The period and other properties of this generator make it very *	useful to 'seed' other generators. * *	This generator is used by other other generators to produce *	various internal values.  In fact, the lower 64 bits of seed *	given to other other generators is passed to sa55rand(). * *      If you need a fast generator and do not need a crypto strong one, *      you should consider using the shuffle generator instead. * *   shuffle: * *	shufrand  - generate a pseudo-random value via a shuffle process *	sshufrand - seed the shufrand generator *	rand      - generate a pseudo-random value over a given range *	srand     - seed the random stream generator * *	This is a generator based on the shuffle generator as described in *	Knuth's "The Art of Computer Programming - Seminumerical Algorithms", *	vol 2, 2nd edition (1981), Section 3.2.2, page 32, Algorithm B. * *	The shuffle generator is fast and serves as a fairly good standard *	pseudo-random generator. * *	The shuffle generator is feed random values by the additive 55 *	generator via a55rand().  Calling a55rand() or sa55rand() will *	affect the shuffle generator output. * *	The rand function is really another interface to the shuffle *	generator.  Unlike shufrand(), rand() can return a value of any *	given size.  The value returned by rand() may be confined to *	either a half open [0,a) (0 <= value < a) or closed interval *	[a,b] (a <= value <= b).  By default, a 64 bit value is returned. * *	Calling srand() simply calls sshufrand() with the same seed. * *   crypto: * *	cryrand   - produce a cryptographically strong pseudo-random number *	scryrand  - seed the crypto generator *	random    - produce a cryptographically strong pseudo-random number *		    over a given range * 	srandom   - seed random * *	This generator is described in the papers: * *	    Blum, Blum, and Shub, "Comparison of Two Pseudorandom Number *	    Generators", in Chaum, D. et. al., "Advances in Cryptology: *	    Proceedings Crypto 82", pp. 61-79, Plenum Press, 1983. * *	    Blum, Blum, and Shub, "A Simple Unpredictable Pseudo-Random *	    Number Generator", SIAM Journal of Computing, v. 15, n. 2, *	    1986, pp. 364-383. * *	    U. V. Vazirani and V. V. Vazirani, "Trapdoor Pseudo-Random *	    Number Generators with Applications to Protocol Design", *	    Proceedings of the 24th  IEEE Symposium on the Foundations *	    of Computer Science, 1983, pp. 23-30. * *	    U. V. Vazirani and V. V. Vazirani, "Efficient and Secure *	    Pseudo-Random Number Generation", Proceedings of the 24th *	    IEEE Symposium on the Foundations of Computer Science, *	    1984, pp. 458-463. * *	    U. V. Vazirani and V. V. Vazirani, "Efficient and Secure *	    Pseudo-Random Number Generation", Advances in Cryptology - *	    Proceedings of CRYPTO '84, Berlin: Springer-Verlag, 1985, *	    pp. 193-202. * *	    "Probabilistic Encryption", Journal of Computer & System *	    Sciences 28, pp. 270-299. * *	We also refer to this generator as the 'Blum' generator. * *	This generator is considered 'strong' in that it passes all *	polynomial-time statistical tests. * *	The crypto generator is not as fast as most generators, though *	it is not painfully slow either. * *	One may fully seed this generator via scryrand().  Calling *	scryrand() with 1 or 3 arguments will result in the additive *	55 generator being seeded with the same seed.  Calling * 	scryrand() with 4 arguments, where the first argument *	is >= 0 will also result in the additive 55 generator *	being seeded with the same seed. * *	The random() generator is really another interface to the *	crypto generator.  Unlike cryrand(), random() can return a *	value confined to either a half open (0 <= value < a) or closed *	interval (a <= value <= b).  By default, a 64 bit value is *	returned. * *	Calling srandom() simply calls scryrand(seed).  The additive *	55 generator will be seeded with the same seed. * * As a bonus, the function 'nxtprime' is provided to produce a probable * prime number. * * All generators come already seeded with precomputed initial constants. * Thus, it is not required to seed a generator before using it. * * Using a seed of '0' will reload generators with their initial states. * In the case of scryrand(), lengths of -1 must also be supplied. * *	sa55rand(0)		initializes only additive 55 *	sshufrand(0)		initializes additive 55 and shuffle *	srand(0)		initializes additive 55 and shuffle *	scryrand(0,-1,-1)	initializes all generators *	scryrand(0)		initializes all generators *	srandom(0)		initializes all generators *	randstate(0)		initializes all generators * * All of the above single arg calls are fairly fast.  In fact, passing * seeding with a non-zero seed, in the above cases, where seed is * not excessively large (many bits long), is also reasonably fast. * * The call: * *	scryrand(-1, ip, iq, ir) * * is fast because no checking is performed on the 'ip', 'iq', or 'ir' * when seed is -1.  NOTE: One must ensure that 'ip', 'iq', are valid * Blum primes and that 'ir' is a quadratic residue of their product! * * A call of scryrand(seed,len1,len2), with len1,len2 > 4, (3 args) * is a somewhat slow as the length args increase.  This type of * call selects 2 primes that are used internally by the crypto * generator.  A call of scryrand(seed,ip,iq,ir) where seed >= 0 * is as slow as the 3 arg case.  See scryrand() for more information. * * A call of scryrand() (no args) may be used to quickly change the * internal state of the crypto and random generators.  Only one major * internal crypto generator value (a quadratic residue) is randomly * selected via the additive 55 generator.  The other 2 major internal * values (the 2 Blum primes) are preserved.  In this form, the additive * 55 is not seeded. * * Calling scryrand(seed,[len1,len2]) (1 or 3 args), or calling * srandom(seed) will leave the additive 55 and shuffle generator in a * seeded state as if srand(seed) has been called.  Calling * scryrand(seed,ip,iq,ir) (4 args), with seed>0 will also leave * the additive 55 generator in the same scryrand(seed) state. * * Calling scryrand() (no args) will not seed the additive * 55 or shuffle generator before or afterwards.  The additive 55 * and shuffle generators will be changed as a side effect of that call. * * Calling srandom(seed) produces the same results as calling scryrand(seed). * * The states of all generators (additive 55, shuffle and crypto) can be * saved and restored via the randstate() function.  Saving the state just * after seeding a generator and restoring it later as a very fast way * to reseed a generator. * * TRUTH IN ADVERTISING: * * The word 'probable', in reference to the nxtprime() function, is used * because of an extremely extremely small chance that a composite (a * non-prime) may be returned.  In no cases will a prime be skipped. * For our purposes, this is sufficient as the chance of returning a * composite is much smaller than the chance that a hardware glitch * will cause nxtprime() to return a bogus result. * * Another "truth in advertising" issue is the use of the term * 'pseudo-random'.  All deterministic generators are pseudo random. * This is opposed to true random generators based on some special * physical device. * * The crypto generator is 'pseudo-random'.  There is no statistical * test, which runs in polynomial time, that can distinguish the crypto * generator from a truly random source. * * A final "truth in advertising" issue deals with how the magic numbers * found in this library were generated.  Detains can be found in the * various functions, while a overview can be found in the SOURCE FOR * MAGIC NUMBERS section below. * **** * * ON THE GENERATORS: * * The additive 55 generator has a good period, and is fast.  It is * reasonable as generators go, though there are better ones available. * We use it in seeding the crypto generator as its period and * other statistical properties are good enough for our purposes. * * This shuffle generator has a very good period, and is fast.  It is * fairly good as generators go, and is better than the additive 55 * generator.  Casual direct use of the shuffle generator may be * acceptable.  Because of this, the interface to the shuffle generator, * but not the additive 55 generator, is advertised when this file is * loaded. * * The shuffle generator functions, shufrand() and rand() use the same * seed and tables.  The shuffle generator shuffles the values produced * by the additive 55 generator.  Calling or seeding the additive 55 * generator will affect the output of the shuffle generator. * * The crypto generator is the best generator in this package.  It * produces a cryptographically strong pseudo-random bit sequence. * Internally, a fixed number of bits are generated after each * generator iteration.  Any unused bits are saved for the next call * to the generator.  The crypto generator is not too slow, though * seeding the generator from scratch is slow.  Shortcuts and * pre-computer seeds have been provided for this reason.  Use of * crypto should be more than acceptable for many applications. * * The crypto seed is in 4 parts, the additive 55 seed (lower 64 * bits of seed), the shuffle seed (all but the lower 64 bits of * seed), and two lengths.  The two lengths specifies the minimum * bit size of two primes used internal to the crypto generator. * Not specifying the lengths, or using -1 will cause crypto to * use the default minimum lengths of 248 and 264 bits, respectively. * * The random() function just another interface to the crypto * generator.  Like rand(), random() provides an interval capability * (closed or open) as well as a 64 bit default return value. * The random() function as good as crypto, and produces numbers * that are equally cryptographically strong.  One may use the * seed functions srandom() or scryrand() for either the random() * or cryrand() functions. * * The seed for all of the generators may be of any size.  Only the * lower 64 bits of seed affect the additive 55 generator.  Bits * beyond the lower 64 bits affect the shuffle generators.  Excessively * large values of seed will result in increased memory usage as * well as a larger seed time for the shuffle and crypto generators. * See REGARDING SEEDS below, for more information. * * One may save and restore the state of all generators via the * randstate() function. * **** * * REGARDING SEEDS: * * Because the generators are interrelated, seeding one generator * will directly or indirectly affect the other generators.  Seeding * the shuffle generator seeds the additive 55 generator.  Seeding * the crypto generator seeds the shuffle generator. * * The seed of '0' implies that a generator should be seeded back * to its initial default state. * * For the moment, seeds < -1 are reserved for future use.  The * value of -1 is used as a special indicator to the fourth form * of scryrand(), and it not a real seed. * * A seed may be of any size.  The additive 55 generator uses only * the lower 64 bits, while the shuffle generator uses bytes beyond * the lower 64 bits. * * To help make the generator produced by seed S, significantly * different from S+1, seeds are scrambled prior to use.  The * function randreseed64() maps [0,2^64) into [0,2^64) in a 1-to-1 * and onto fashion. * * The purpose of the randreseed64() is not to add security.  It * simply helps remove the human perception of the relationship * between the seed and the production of the generator. * * The randreseed64() process does not reduce the security of the * generators.  Every seed is converted into a different unique seed. * No seed is ignored or favored. * * There is no limit on the size of a seed.  On the other hand, * extremely large seeds require large tables and long seed times. * Using a seed in the range of [2^64, 2^64 * 128!) should be * sufficient for most purposes.  An easy way to stay within this * range to to use seeds that are between 21 and 215 digits, or 64 to * 780 bits long. * **** * * SOURCE OF MAGIC NUMBERS: * * Most of the magic constants used on this library ultimately are * based on the Rand book of random numbers.  The Rand book contains * 10^6 decimal digits, generated by a physical process.  This book, * produced by the Rand corporation in the 1950's is considered * a standard against which other generators may be measured. * * The Rand book of numbers was groups into groups of 20 digits. * The first 55 groups < 2^64 were used to initialize add55_init_tbl. * The size of 20 digits was used because 2^64 is 20 digits long. * The restriction of < 2^64 was used to prevent modulus biasing. * (see the note on  modulus biasing in rand()). * * The additive 55 generator during seeding is used 128 times to help * remove the initial seed state from the initial values produced. * The loop count of 128 was a power of 2 that permits each of the * 55 table entries to be processed at least twice. * * The function, randreseed64(), uses 4 primes to scramble 64 bits * into 64 bits.  These primes were also extracted from the Rand * book of numbers.  See sshufrand() for details. * * The default shuffle table size of 128 entries is the power of 2 * that is longer than the 100 entries recommended by Knuth for * the shuffle algorithm (see the text cited in shufrand()). * We use a power of 2 shuffle table length so that the shuffle * process can select a table entry from a new additive 55 value * by extracting its top most bits. * * The quadratic residue search performed by cryres() starts at * a value that is in the interval [2^sqrpow,n-100], where '2^sqrpow' * is the smallest power of 2 >= 'n^(3/4)' where 'n=p*q'.  We also * reject any initial residue whose square (mod n) does not fit * this same restriction.  Finally, we reject any residue that * is within 100 of its square (mod n). * * The use of 'n^(3/4)' insures that the quadratic residue is * large, but not too large.  We want to avoid residues that are * near 0 or that are near 'n'.  Such residues are trivial or

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级日韩不卡播放免费| 国产亲近乱来精品视频 | 国产午夜精品久久久久久久 | 三级在线观看一区二区| 国产日产亚洲精品系列| 欧美日韩午夜在线视频| 国产精品一线二线三线精华| 一区二区三区影院| 久久久久久久综合| 欧美一区二区三区色| 91视频国产资源| 久久99精品国产91久久来源| 亚洲乱码精品一二三四区日韩在线| 欧美大片日本大片免费观看| 在线视频你懂得一区| 福利一区二区在线| 久久精品国产77777蜜臀| 亚洲香蕉伊在人在线观| 国产精品久久久久一区| 久久女同互慰一区二区三区| 欧美精品18+| 在线观看www91| 91天堂素人约啪| 懂色av中文一区二区三区| 久久国产夜色精品鲁鲁99| 亚洲成a人在线观看| 亚洲美女精品一区| 国产精品短视频| 亚洲国产精品99久久久久久久久 | 亚洲综合一区在线| 亚洲欧洲美洲综合色网| 国产精品欧美久久久久一区二区 | 久久精品一区二区三区av| 91精品国产91综合久久蜜臀| 欧美日韩精品免费| 欧美在线你懂得| 欧美色图免费看| 欧美午夜在线一二页| 色久优优欧美色久优优| 91色在线porny| 91在线视频18| 色婷婷国产精品久久包臀| 色又黄又爽网站www久久| 色综合婷婷久久| 一本大道久久a久久综合| 在线观看av一区| 欧美日韩中文另类| 欧美精品三级在线观看| 91精品国产综合久久精品图片| 欧美精品三级日韩久久| 日韩欧美国产高清| 久久久久高清精品| 中文字幕一区日韩精品欧美| 1区2区3区欧美| 一区二区三区国产豹纹内裤在线 | 亚洲免费观看高清完整版在线观看| 18成人在线观看| 国产精品久久久久国产精品日日| 国产精品久久久久久久久动漫 | 三级欧美在线一区| 欧美aaaaaa午夜精品| 激情综合网av| 大桥未久av一区二区三区中文| 成人精品高清在线| 欧洲一区二区av| 欧美一区二区三区婷婷月色| 欧美精品一区二区三区四区| 欧美国产乱子伦| 夜夜操天天操亚洲| 狂野欧美性猛交blacked| 懂色av中文字幕一区二区三区| 91视频一区二区| 91精品国产综合久久久久久漫画| 久久嫩草精品久久久精品| 亚洲欧美一区二区不卡| 午夜欧美在线一二页| 激情小说欧美图片| 91丨九色丨尤物| 欧美一区二区视频免费观看| 国产日韩成人精品| 亚洲成人在线观看视频| 国产精品91一区二区| 日本高清免费不卡视频| 欧美一级片在线看| 亚洲欧洲成人自拍| 美女在线观看视频一区二区| 99视频热这里只有精品免费| 欧美一卡2卡三卡4卡5免费| 国产女主播在线一区二区| 亚洲成人免费电影| 国产盗摄一区二区| 欧美日韩免费在线视频| 国产午夜精品久久久久久久| 五月激情综合网| 成人激情免费网站| 欧美一区欧美二区| 亚洲欧美国产三级| 国产精品夜夜嗨| 在线播放91灌醉迷j高跟美女| 国产午夜亚洲精品不卡| 日韩制服丝袜先锋影音| 一本色道久久综合亚洲91| 久久综合国产精品| 日本不卡高清视频| 在线观看日产精品| 中文字幕va一区二区三区| 美女一区二区视频| 欧美日韩一级片网站| 中文字幕精品一区| 国产在线视频精品一区| 91精品国产综合久久精品性色| 亚洲精选视频在线| 国产成人一区二区精品非洲| 欧美一级欧美一级在线播放| 亚洲高清免费视频| 91小视频免费观看| 中文在线一区二区| 精品一区二区影视| 欧美片在线播放| 亚洲制服丝袜一区| 99久久伊人网影院| 中文字幕欧美区| 国产成人综合在线播放| 精品国偷自产国产一区| 青娱乐精品在线视频| 欧美日韩视频在线第一区| 亚洲综合另类小说| 色8久久人人97超碰香蕉987| 国产精品久久国产精麻豆99网站| 国产一区二区三区不卡在线观看| 日韩欧美一级精品久久| 美女视频一区在线观看| 日韩一区二区在线观看视频| 日日摸夜夜添夜夜添亚洲女人| 精品视频在线免费看| 亚洲成av人影院在线观看网| 欧美自拍偷拍午夜视频| 亚洲午夜精品在线| 欧美日韩黄色影视| 日本大胆欧美人术艺术动态| 在线不卡欧美精品一区二区三区| 日韩有码一区二区三区| 欧美精品日日鲁夜夜添| 日本vs亚洲vs韩国一区三区| 日韩一区二区在线看片| 久久97超碰色| 久久久不卡影院| 不卡大黄网站免费看| 国产精品三级av| 91看片淫黄大片一级| 亚洲午夜在线视频| 91精品国产综合久久蜜臀| 久久超级碰视频| 国产欧美日韩麻豆91| 99久久精品国产麻豆演员表| 亚洲精品国产一区二区精华液 | 97精品电影院| 一区二区三区成人| 欧美福利电影网| 精品一区二区免费视频| 国产午夜一区二区三区| 91亚洲精品一区二区乱码| 无码av中文一区二区三区桃花岛| 日韩午夜激情电影| 国产成人福利片| 亚洲最大的成人av| 日韩欧美视频一区| 国产成人精品一区二区三区四区 | 极品少妇xxxx精品少妇| 中文字幕在线播放不卡一区| 欧美性一二三区| 国内精品不卡在线| 亚洲美女视频在线观看| 欧美一卡在线观看| 成人app网站| 五月天欧美精品| 欧美高清在线一区| 欧美日韩一区在线| 福利一区二区在线观看| 午夜精品一区在线观看| 久久久久综合网| 欧美写真视频网站| 国产传媒日韩欧美成人| 五月天激情小说综合| 国产精品欧美一区二区三区| 欧美精品久久久久久久多人混战 | 欧美成人激情免费网| 不卡电影免费在线播放一区| 石原莉奈一区二区三区在线观看| 中文字幕av资源一区| 91精品国产综合久久香蕉的特点 | 国产精品美女久久久久久2018| 欧美亚洲尤物久久| 国产成人精品网址| 性做久久久久久久免费看| 国产精品久久毛片av大全日韩| 欧美一级专区免费大片| 91久久精品国产91性色tv| 国产精品一区二区在线观看网站| 亚洲大片在线观看|