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

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

?? randm.c

?? FreeRtos Source code Version 4.04
?? C
字號:
/****************************************************************************** randm.c - Random number generator program file.** Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.* Copyright (c) 1998 by Global Election Systems Inc.** The authors hereby grant permission to use, copy, modify, distribute,* and license this software and its documentation for any purpose, provided* that existing copyright notices are retained in all copies and that this* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required* for any of the authorized uses.** THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.******************************************************************************** REVISION HISTORY** 03-01-01 Marc Boucher <marc@mbsi.ca>*   Ported to lwIP.* 98-06-03 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.*   Extracted from avos.*****************************************************************************/#include "ppp.h"#if PPP_SUPPORT > 0#include "md5.h"#include "randm.h"#include "pppdebug.h"#if MD5_SUPPORT>0   /* this module depends on MD5 */#define RANDPOOLSZ 16   /* Bytes stored in the pool of randomness. *//*****************************//*** LOCAL DATA STRUCTURES ***//*****************************/static char randPool[RANDPOOLSZ];   /* Pool of randomness. */static long randCount = 0;      /* Pseudo-random incrementer *//***********************************//*** PUBLIC FUNCTION DEFINITIONS ***//***********************************//* * Initialize the random number generator. * * Since this is to be called on power up, we don't have much *  system randomess to work with.  Here all we use is the *  real-time clock.  We'll accumulate more randomness as soon *  as things start happening. */void avRandomInit(){    avChurnRand(NULL, 0);}/* * Churn the randomness pool on a random event.  Call this early and often *  on random and semi-random system events to build randomness in time for *  usage.  For randomly timed events, pass a null pointer and a zero length *  and this will use the system timer and other sources to add randomness. *  If new random data is available, pass a pointer to that and it will be *  included. * * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 */void avChurnRand(char *randData, u32_t randLen){    MD5_CTX md5;/*  ppp_trace(LOG_INFO, "churnRand: %u@%P\n", randLen, randData); */    MD5Init(&md5);    MD5Update(&md5, (u_char *)randPool, sizeof(randPool));    if (randData)        MD5Update(&md5, (u_char *)randData, randLen);    else {        struct {            /* INCLUDE fields for any system sources of randomness */            char foobar;        } sysData;        /* Load sysData fields here. */        ;        MD5Update(&md5, (u_char *)&sysData, sizeof(sysData));    }    MD5Final((u_char *)randPool, &md5);/*  ppp_trace(LOG_INFO, "churnRand: -> 0\n"); */}/* * Use the random pool to generate random data.  This degrades to pseudo *  random when used faster than randomness is supplied using churnRand(). * Note: It's important that there be sufficient randomness in randPool *  before this is called for otherwise the range of the result may be *  narrow enough to make a search feasible. * * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 * * XXX Why does he not just call churnRand() for each block?  Probably *  so that you don't ever publish the seed which could possibly help *  predict future values. * XXX Why don't we preserve md5 between blocks and just update it with *  randCount each time?  Probably there is a weakness but I wish that *  it was documented. */void avGenRand(char *buf, u32_t bufLen){    MD5_CTX md5;    u_char tmp[16];    u32_t n;    while (bufLen > 0) {        n = LWIP_MIN(bufLen, RANDPOOLSZ);        MD5Init(&md5);        MD5Update(&md5, (u_char *)randPool, sizeof(randPool));        MD5Update(&md5, (u_char *)&randCount, sizeof(randCount));        MD5Final(tmp, &md5);        randCount++;        memcpy(buf, tmp, n);        buf += n;        bufLen -= n;    }}/* * Return a new random number. */u32_t avRandom(){    u32_t newRand;    avGenRand((char *)&newRand, sizeof(newRand));    return newRand;}#else /* MD5_SUPPORT *//*****************************//*** LOCAL DATA STRUCTURES ***//*****************************/static int  avRandomized = 0;       /* Set when truely randomized. */static u32_t avRandomSeed = 0;      /* Seed used for random number generation. *//***********************************//*** PUBLIC FUNCTION DEFINITIONS ***//***********************************//* * Initialize the random number generator. * * Here we attempt to compute a random number seed but even if * it isn't random, we'll randomize it later. * * The current method uses the fields from the real time clock, * the idle process counter, the millisecond counter, and the * hardware timer tick counter.  When this is invoked * in startup(), then the idle counter and timer values may * repeat after each boot and the real time clock may not be * operational.  Thus we call it again on the first random * event. */void avRandomInit(){#if 0    /* Get a pointer into the last 4 bytes of clockBuf. */    u32_t *lptr1 = (u32_t *)((char *)&clockBuf[3]);    /*     * Initialize our seed using the real-time clock, the idle     * counter, the millisecond timer, and the hardware timer     * tick counter.  The real-time clock and the hardware     * tick counter are the best sources of randomness but     * since the tick counter is only 16 bit (and truncated     * at that), the idle counter and millisecond timer     * (which may be small values) are added to help     * randomize the lower 16 bits of the seed.     */    readClk();    avRandomSeed += *(u32_t *)clockBuf + *lptr1 + OSIdleCtr             + ppp_mtime() + ((u32_t)TM1 << 16) + TM1;#else    avRandomSeed += sys_jiffies(); /* XXX */#endif            /* Initialize the Borland random number generator. */    srand((unsigned)avRandomSeed);}/* * Randomize our random seed value.  Here we use the fact that * this function is called at *truely random* times by the polling * and network functions.  Here we only get 16 bits of new random * value but we use the previous value to randomize the other 16 * bits. */void avRandomize(void){    static u32_t last_jiffies;    if (!avRandomized) {        avRandomized = !0;        avRandomInit();        /* The initialization function also updates the seed. */    } else {/*        avRandomSeed += (avRandomSeed << 16) + TM1; */    	avRandomSeed += (sys_jiffies() - last_jiffies); /* XXX */    }    last_jiffies = sys_jiffies();}/* * Return a new random number. * Here we use the Borland rand() function to supply a pseudo random * number which we make truely random by combining it with our own * seed which is randomized by truely random events.  * Thus the numbers will be truely random unless there have been no * operator or network events in which case it will be pseudo random * seeded by the real time clock. */u32_t avRandom(){    return ((((u32_t)rand() << 16) + rand()) + avRandomSeed);}#endif /* MD5_SUPPORT */#endif /* PPP_SUPPORT */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品久久久久久免费视 | 精品99一区二区三区| 欧美mv日韩mv| 亚洲久本草在线中文字幕| 久久精品国产一区二区三区免费看| 成人av动漫网站| 日韩欧美美女一区二区三区| 亚洲伦在线观看| 国产乱人伦偷精品视频免下载| 欧美怡红院视频| 国产精品国产三级国产aⅴ原创 | 7777精品伊人久久久大香线蕉的 | 精品写真视频在线观看| 日本精品裸体写真集在线观看| 国产视频不卡一区| 99在线精品视频| 成人激情免费网站| 欧美videos中文字幕| 一区二区三区中文在线| 成人免费高清在线| 久久久久综合网| 韩国精品免费视频| 欧美电影免费观看高清完整版在 | 欧美三级视频在线| 国产精品第五页| 成人中文字幕在线| 91精品国产品国语在线不卡| 亚洲国产美女搞黄色| 9色porny自拍视频一区二区| 国产欧美日韩不卡| 国产精品综合在线视频| 精品精品国产高清a毛片牛牛| 日韩国产高清在线| 欧美精品xxxxbbbb| 爽好多水快深点欧美视频| 欧美中文字幕一区二区三区亚洲| 成人免费视频在线观看| 91一区一区三区| 亚洲精品免费播放| 在线观看欧美精品| 亚洲国产中文字幕| 欧美精品久久天天躁| 国产一区二区三区美女| 久久久综合视频| 成人aa视频在线观看| ●精品国产综合乱码久久久久| 99麻豆久久久国产精品免费 | 国产精品欧美极品| 91玉足脚交白嫩脚丫在线播放| 中文字幕一区av| 欧美色网一区二区| 日韩—二三区免费观看av| 日韩精品中文字幕在线不卡尤物 | 亚洲美女免费在线| 欧美三级午夜理伦三级中视频| 午夜av一区二区| 欧美变态凌虐bdsm| 成人黄页在线观看| 亚洲一区二区偷拍精品| 欧美一级理论性理论a| 国产成人综合在线| 亚洲欧美成aⅴ人在线观看| 欧美日韩国产精选| 国产一区二区三区在线观看免费 | 国产激情一区二区三区四区| 日本一区二区电影| 欧美日韩一区视频| 国产成人在线网站| 亚洲一二三区在线观看| 26uuu亚洲婷婷狠狠天堂| 大桥未久av一区二区三区中文| 亚洲猫色日本管| 日韩欧美国产麻豆| 色综合久久中文综合久久97| 奇米色一区二区三区四区| 国产精品无遮挡| 91精品国产高清一区二区三区蜜臀| 国产精品伊人色| 亚洲h在线观看| 国产精品久久国产精麻豆99网站| 欧美三级电影在线看| 国产乱码字幕精品高清av| 亚洲无线码一区二区三区| 国产午夜三级一区二区三| 7777精品久久久大香线蕉| 国产91在线观看| 日本一区中文字幕| 夜夜精品视频一区二区| 国产欧美日韩另类一区| 亚洲欧洲一区二区在线播放| 欧美日韩国产高清一区二区| 不卡av在线免费观看| 久久99精品网久久| 日本强好片久久久久久aaa| 亚洲激情在线播放| 国产色婷婷亚洲99精品小说| 日韩欧美国产高清| 91精品国产aⅴ一区二区| 在线免费观看视频一区| 97久久人人超碰| 懂色av一区二区夜夜嗨| 激情偷乱视频一区二区三区| 日韩中文字幕1| 亚洲成国产人片在线观看| 亚洲欧美电影院| 最近中文字幕一区二区三区| 中文字幕不卡一区| 国产亚洲一区二区三区| 久久久亚洲高清| 日韩美女一区二区三区| 欧美www视频| 精品欧美乱码久久久久久| 精品剧情在线观看| 日韩视频永久免费| 日韩亚洲欧美成人一区| 在线成人av网站| 91精品国产手机| 欧美一卡在线观看| 欧美一区二区三区不卡| 欧美一区二区三区电影| 日韩精品一区二区三区中文不卡| 日韩三级视频中文字幕| 欧美一区二区三区免费视频| 日韩免费电影一区| 国产日韩欧美制服另类| 国产午夜亚洲精品不卡| 国产精品午夜在线观看| 亚洲欧美自拍偷拍| 悠悠色在线精品| 亚洲一区二区三区视频在线播放| 亚洲国产综合人成综合网站| 亚洲sss视频在线视频| 丝袜国产日韩另类美女| 久久草av在线| 成人久久视频在线观看| 91免费视频网| 91精品国产高清一区二区三区蜜臀 | 成人午夜电影小说| 不卡视频在线观看| 欧美在线播放高清精品| 日韩免费高清视频| 国产精品久久综合| 亚洲成在人线免费| 国产永久精品大片wwwapp| 成人综合婷婷国产精品久久蜜臀 | 成人在线一区二区三区| 91尤物视频在线观看| 91精品国产综合久久久久久漫画| 日韩免费观看高清完整版 | 国产精品一二一区| 色综合久久天天综合网| 欧美精品一二三| 日本一区二区三区久久久久久久久不| 亚洲激情图片一区| 精品一区二区三区在线播放 | 久久久久久99精品| 亚洲精品国产a| 国产一区二区精品久久| 91亚洲精品乱码久久久久久蜜桃| 717成人午夜免费福利电影| 国产精品美女www爽爽爽| 日韩和欧美一区二区| 99久久精品国产观看| 日韩视频一区二区三区在线播放| 国产精品久久久久久久浪潮网站| 日韩精品一二三四| 91猫先生在线| 国产欧美一区二区精品久导航 | 91蝌蚪国产九色| 日韩精品在线一区二区| 亚洲一区二区在线观看视频| 激情五月婷婷综合网| 在线观看区一区二| 中文字幕在线不卡视频| 国产一区二区免费看| 69成人精品免费视频| 亚洲乱码国产乱码精品精98午夜| 国产在线精品一区二区不卡了| 欧美色精品在线视频| 国产精品国产三级国产aⅴ入口| 激情综合五月婷婷| 在线成人免费视频| 亚洲第一久久影院| 在线观看中文字幕不卡| 亚洲人成网站精品片在线观看| 色婷婷av一区二区| 国产精品视频麻豆| 国产一区二区精品久久91| 日韩精品专区在线| 美女视频黄久久| 7777精品伊人久久久大香线蕉最新版 | 欧美伦理视频网站| 一区二区三区在线免费观看| 成人激情开心网| 中文字幕欧美激情| youjizz久久| 国产精品嫩草影院com| av在线不卡网| 亚洲欧美自拍偷拍色图| 91免费观看视频|