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

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

?? pgprndmac.c

?? PGP8.0源碼 請認真閱讀您的文件包然后寫出其具體功能
?? C
字號:
/*
 * Get high-resolution timing information to seed the random number generator.
 * Mac version.  (The complicated one.)
 *
 * $Id: pgpRndMac.c,v 1.4 2001/01/25 22:11:37 jeffc Exp $
 */

#include "pgpConfig.h"

#include <stdlib.h>	/* For qsort() */

#include <Timer.h>

#include "pgpMem.h"
#include "pgpRnd.h"
#include "pgpRandomPoolPriv.h"
#include "pgpUsuals.h"

#define MINTICK 0

/* Number of deltas to try (at least 5, preferably odd) */
#define kNumDeltas 15	

typedef UnsignedWide timetype;

/* Function needed for qsort() */
static int
ranCompare(void const *p1, void const *p2)
{
	return *(PGPUInt32 const *)p1 > *(PGPUInt32 const *)p2 ?  1 :
	       *(PGPUInt32 const *)p1 < *(PGPUInt32 const *)p2 ? -1 : 0;
}

/*
 * XXX: Not necessarily accurate!
 *
 * This returns t1 - t2 if it fits in an unsigned long, or else it returns 0
 * if negative or ULONG_MAX if out of range.
 */
static unsigned long
tickdiff(UnsignedWide const t1, UnsignedWide const t2)
{
	if (t1.hi == t2.hi)
	{
		if (t1.lo >= t2.lo)
			return t1.lo - t2.lo;
		else
			return 0;
	}
	else if (t1.hi == t2.hi + 1)
	{
		if (t1.lo < t2.lo)
			return t1.lo - t2.lo;	/* This underflows, */
						/* and that's the intent */
		else
			return ULONG_MAX;
	}
	else if (t1.hi < t2.hi)
		return 0;
	else
		return ULONG_MAX;
}

#if TARGET_CPU_PPC
/* Sample the timebase register */

static asm void GetClock(register timetype *t)
{
	mftb	r7, 268
	stw		r7, 4(t)
	mftb	r7, 269
	stw		r7, 0(t)
	blr
}

#else

static void GetClock(register timetype *t)
{
	Microseconds( t );
}

#endif

/*
 * Find the resolution of the high-resolution clock by sampling successive
 * values until a tick boundary, at which point the delta is entered into
 * a table.  An average near the median of the table is taken and returned
 * as the system tick size to eliminate outliers due to descheduling (high)
 * or tv0 not being the "zero" time in a given tick (low).
 *
 * Some trickery is needed to defeat the habit systems have of always
 * incrementing the microseconds field from gettimeofday() results so that
 * no two calls return the same value.  Thus, a "tick boundary" is assumed
 * when successive calls return a difference of more than MINTICK ticks.
 * (For gettimeofday(), this is set to 2 us.)  This catches cases where at
 * most one other task reads the clock between successive reads by this task.
 * More tasks in between are rare enough that they'll get cut off by the
 * median filter.
 *
 * When a tick boundary is found, the *first* time read during the previous
 * tick (tv0) is subtracted from the new time to get microseconds per tick.
 *
 * Suns have a 1 us timer, and as of SunOS 4.1, they return that timer, but
 * there is ~50 us of system-call overhead to get it, so this overestimates
 * the tick size considerably.  On SunOS 5.x/Solaris, the overhead has been
 * cut to about 2.5 us, so the measured time alternates between 2 and 3 us.
 * Some better algorithms will be required for future machines that really
 * do achieve 1 us granularity.
 *
 * Current best idea: discard all this hair and use Ueli Maurer's entropy
 * estimation scheme.  Assign each input event (delta) a sequence number.
 * 16 bits should be more than adequate.  Make a table of the last time
 * (by sequence number) each possibe input event occurred.  For practical
 * implementation, hash the event to a fixed-size code and consider two
 * events identical if they have the same hash code.  This will only ever
 * underestimate entropy.  Then use the number of bits in the difference
 * between the current sequence number and the previous one as the entropy
 * estimate.
 *
 * If it's desirable to use longer contexts, Maurer's original technique
 * just groups events into non-overlapping pairs and uses the technique on
 * the pairs.  If you want to increment the entropy numbers on each keystroke
 * for user-interface niceness, you can do the operation each time, but you
 * have to halve the sequence number difference before starting, and then you
 * have to halve the number of bits of entropy computed because you're adding
 * them twice.
 *
 * You can put the even and odd events into separate tables to close Maurer's
 * model exactly, or you can just dump them into the same table, which will
 * be more conservative.
 */
static PGPUInt32
ranTickSize(void)
{
	int i = 0, j = 0;
	PGPUInt32	diff, d[kNumDeltas];
	timetype	tv0, tv1, tv2;
	
	/*
	 * TODO Get some per-run data to seed the RNG with.
	 * pid, ppid, etc.
	 */
	GetClock(&tv0);
	tv1 = tv0;
	do {
		GetClock(&tv2);
		diff = tickdiff(tv2, tv1);
		if (diff > MINTICK) {
			d[i++] = diff;
			tv0 = tv2;
			j = 0;
		} else if (++j >= 4096)	/* Always getting <= MINTICK units */
			return MINTICK + !MINTICK;
		tv1 = tv2;
	} while (i < kNumDeltas);

	/* Return average of middle 5 values (rounding up) */
	qsort(d, kNumDeltas, sizeof(d[0]), ranCompare);
	diff = (d[kNumDeltas / 2 - 2] + d[kNumDeltas / 2 - 1] +
			d[kNumDeltas / 2] + d[kNumDeltas / 2 + 1] +
			d[kNumDeltas/2 + 2] + 4) / 5;
#if NOISEDEBUG
	fprintf(stderr, "Tick size is %u\n", diff);
#endif
	return diff;
}


/*
 * Add as much timing-dependent random noise as possible
 * to the randPool.  Typically, this involves reading the most
 * accurate system clocks available.
 *
 * Returns the number of ticks that have passed since the last call,
 * for entropy estimation purposes.
 */
	PGPUInt32
pgpRandomCollectEntropy(PGPRandomContext const *rc)
{
	PGPUInt32 delta;
	timetype t;
	static PGPUInt32 ticksize = 0;
	static timetype prevt;

	GetClock(&t);
	pgpRandomAddBytes(rc, (PGPByte const *)&t, sizeof(t));

	if (!ticksize)
	{
		ticksize = ranTickSize();
		prevt = t;
	}
	delta = (PGPUInt32)(tickdiff(t, prevt) / ticksize);
	prevt = t;

	return delta;
}

/*
 * pgpRandomCollectOsData
 *	Add random process and thread performance data noise
 *	to the random pool.
 */
	PGPBoolean
pgpRandomCollectOsData(PGPRandomContext const *rc, PGPBoolean slow)
{
	long		gestaltResult;
	timetype 	t;
	const VCB	*curVCB;
	
	(void) slow;
	GetClock(&t);
	pgpRandomAddBytes(rc, (PGPByte const *)&t, sizeof(t));
	
	if( Gestalt( gestaltLowMemorySize, &gestaltResult ) == noErr )
	{
		/* Add all of lowmem (except first byte) into pool */
		pgpRandomAddBytes( rc, (PGPByte *) 1, gestaltResult - 1 );
	}
	
	/* Add all VCB's into the pool */
	curVCB = (const VCB *) GetVCBQHdr()->qHead;
	while( IsntNull( curVCB ) )
	{
		pgpRandomAddBytes( rc, (PGPByte *) curVCB, sizeof( *curVCB ) );
		
		curVCB = (const VCB *) curVCB->qLink;
	}
	
	return TRUE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品狼人久久影院观看方式| 欧美一区在线视频| 国产一二三精品| 奇米888四色在线精品| 亚洲va韩国va欧美va| 亚洲777理论| 喷水一区二区三区| 韩国在线一区二区| 国产成人在线网站| 99re这里只有精品视频首页| 一本大道av一区二区在线播放| www.激情成人| 色婷婷综合中文久久一本| 色吊一区二区三区| 555夜色666亚洲国产免| 日韩午夜av电影| 国产夜色精品一区二区av| 中文字幕av一区二区三区| 亚洲同性gay激情无套| 亚洲乱码中文字幕综合| 亚洲卡通欧美制服中文| 亚洲国产中文字幕| 精品一区二区免费视频| 成人午夜激情视频| 欧美日韩国产成人在线免费| 欧美xxxxxxxx| 国产精品二三区| 亚洲高清视频中文字幕| 狠狠v欧美v日韩v亚洲ⅴ| 91网站在线播放| 欧美一区二区免费| 中文字幕一区二区三区乱码在线| 亚洲国产裸拍裸体视频在线观看乱了| 日韩高清国产一区在线| 国产不卡视频一区二区三区| 色狠狠色噜噜噜综合网| 日韩欧美在线观看一区二区三区| 国产欧美日韩不卡| 视频一区在线播放| 成人免费观看视频| 91精品国产综合久久久久久久| 国产欧美日韩精品a在线观看| 亚洲综合在线电影| 国产乱码精品一区二区三区五月婷| 色婷婷av一区二区三区软件| 精品不卡在线视频| 夜夜精品视频一区二区| 国产精品一二三区在线| 欧美视频中文字幕| 日韩美女久久久| 国产毛片一区二区| 欧美电影一区二区三区| 亚洲精品综合在线| 99久久伊人网影院| 久久九九国产精品| 六月丁香婷婷久久| 精品污污网站免费看| 国产精品网站在线| 国产乱理伦片在线观看夜一区 | 欧美成人精品二区三区99精品| 国产精品萝li| 国产精品一区在线观看你懂的| 欧美美女一区二区三区| 亚洲精品欧美综合四区| 91在线国产观看| 国产精品私人影院| 国产成人精品综合在线观看 | 亚洲精品一线二线三线| 污片在线观看一区二区| 91精彩视频在线观看| 亚洲欧美福利一区二区| 91视频一区二区| 自拍偷拍欧美激情| 成人av资源在线| 国产精品欧美精品| 成人av在线资源网站| 国产精品视频一二| 91免费观看视频| 亚洲制服丝袜在线| 欧美日韩一卡二卡三卡| 亚洲国产成人av| 日韩一区国产二区欧美三区| 日韩极品在线观看| 日韩欧美电影一二三| 韩国理伦片一区二区三区在线播放| 欧美xxxxx裸体时装秀| 国产一区二区不卡在线| 中文字幕国产一区| 色综合久久综合网欧美综合网| 亚洲欧美在线另类| 欧美亚洲高清一区| 另类小说一区二区三区| 久久香蕉国产线看观看99| 国产一区二区0| 国产精品传媒视频| 99re6这里只有精品视频在线观看| 亚洲人吸女人奶水| 欧美福利电影网| 国产综合色视频| 国产精品久久久久影院老司| 91福利区一区二区三区| 青青草原综合久久大伊人精品 | 色综合色综合色综合色综合色综合| 国产精品国产三级国产aⅴ原创 | 日韩电影在线免费观看| 国产视频不卡一区| 欧美午夜片在线看| 国产91综合一区在线观看| 一区二区三区四区乱视频| 日韩一区和二区| 9l国产精品久久久久麻豆| 日本午夜精品一区二区三区电影| 中文字幕第一区第二区| 91精品国产综合久久精品麻豆| 国产成人av资源| 日韩不卡手机在线v区| 综合久久久久久久| 精品日韩成人av| 日本精品裸体写真集在线观看| 久久狠狠亚洲综合| 亚洲一区二区三区四区五区黄| 久久久天堂av| 欧美区一区二区三区| 成人丝袜视频网| 久久99精品国产麻豆不卡| 亚洲一区二区三区激情| 国产精品久久久久久久久免费丝袜| 欧美一级欧美一级在线播放| 91免费国产在线观看| 岛国av在线一区| 奇米一区二区三区| 亚洲一区在线看| 国产精品久久久久久久久免费桃花 | 欧美人伦禁忌dvd放荡欲情| 国产成人av一区二区三区在线观看| 亚洲人成小说网站色在线| 日韩美女在线视频| 在线观看91精品国产麻豆| 在线免费精品视频| 色妹子一区二区| 不卡av免费在线观看| 高清shemale亚洲人妖| 国产一区二区不卡老阿姨| 美女脱光内衣内裤视频久久网站| 一区二区三区在线免费播放| 中文字幕av一区二区三区| 国产偷国产偷精品高清尤物| 精品国产一区二区三区久久影院 | 图片区日韩欧美亚洲| 亚洲一区在线电影| 亚洲一区二区三区中文字幕在线| 亚洲视频小说图片| 一区二区高清在线| 亚洲国产精品久久久久婷婷884| 中文字幕在线视频一区| 中文字幕欧美日本乱码一线二线 | 欧美日本在线播放| 欧洲激情一区二区| 欧美日韩三级在线| 欧美一区二区三区免费在线看| 欧美巨大另类极品videosbest | 婷婷综合久久一区二区三区| 亚洲成av人片| 蜜臀久久久99精品久久久久久| 免费成人在线影院| 激情五月播播久久久精品| 国产久卡久卡久卡久卡视频精品| 国产最新精品免费| 成人av电影在线| 欧美亚一区二区| 日韩免费性生活视频播放| 久久久.com| 一区二区日韩av| 蜜臀久久99精品久久久久宅男| 激情综合网天天干| 成人福利视频网站| 欧洲av一区二区嗯嗯嗯啊| 欧美电影免费提供在线观看| 久久精品欧美日韩精品| 日韩美女视频一区| 蜜臀精品一区二区三区在线观看 | 国产日产欧美精品一区二区三区| 中文字幕高清不卡| 亚洲v日本v欧美v久久精品| 精品亚洲成a人在线观看| 成人av电影在线| 欧美一级视频精品观看| 国产精品久久久久一区二区三区 | 精品国产一区二区在线观看| 中文字幕欧美国产| 日日夜夜一区二区| 成人久久18免费网站麻豆| 在线不卡免费欧美| 国产精品入口麻豆原神| 五月激情综合色| eeuss鲁一区二区三区| 91精品国模一区二区三区| 亚洲欧洲色图综合| 国产一区亚洲一区| 欧美一级高清大全免费观看|