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

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

?? randm.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? 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一区二区三区免费野_久草精品视频
91免费小视频| 国产日韩在线不卡| 91麻豆精品在线观看| 国产成人免费视频网站| 国产99久久精品| 国产成人av电影在线观看| 日本一区中文字幕| 久久精品噜噜噜成人av农村| 日本亚洲电影天堂| 欧美精品少妇一区二区三区 | 中文字幕第一区综合| 精品国精品国产| 精品国产一区二区亚洲人成毛片| 日韩一区二区三区视频| 久久亚洲一级片| 国产欧美精品一区二区色综合| 日本一区二区免费在线| 国产精品久久久久影院亚瑟| 国产精品国产三级国产aⅴ中文| 亚洲视频免费看| 亚洲亚洲人成综合网络| 美女视频黄a大片欧美| 国产一区二区三区日韩| 成人性生交大片免费看视频在线| 色婷婷综合久久久久中文一区二区 | 综合亚洲深深色噜噜狠狠网站| 亚洲美女电影在线| 亚洲电影视频在线| 国产综合久久久久久鬼色| jlzzjlzz国产精品久久| 欧美日韩黄色一区二区| 国产亚洲精品7777| 亚洲一区自拍偷拍| 国产剧情一区在线| 欧美日韩一区二区三区在线看| 欧美成人r级一区二区三区| 中文字幕视频一区二区三区久| 婷婷一区二区三区| 国产suv精品一区二区6| 911精品产国品一二三产区| 国产精品欧美极品| 美女网站色91| 色狠狠一区二区| 久久只精品国产| 夜夜嗨av一区二区三区网页| 久久精品免费看| 欧美少妇性性性| 国产精品久久一卡二卡| 毛片不卡一区二区| 色狠狠综合天天综合综合| 国产亚洲欧美一区在线观看| 亚洲高清视频中文字幕| 高清日韩电视剧大全免费| 日韩一二三区不卡| 一区二区三区精密机械公司| 国产一区二区美女| 欧美一级在线观看| 亚洲午夜免费电影| 色综合天天综合网天天狠天天| 欧美精品一区二区久久久| 日韩va亚洲va欧美va久久| 在线免费观看日本欧美| 国产精品色噜噜| 国产一区 二区 三区一级| 91精品欧美综合在线观看最新| 一区二区三区四区蜜桃| 北条麻妃一区二区三区| 久久久一区二区三区捆绑**| 久久国产精品72免费观看| 欧美一区日韩一区| 日韩和的一区二区| 在线成人高清不卡| 日韩高清欧美激情| 欧美顶级少妇做爰| 免费一级片91| 日韩欧美一区在线| 乱一区二区av| 国产日本欧美一区二区| 国产经典欧美精品| 国产精品免费久久久久| 国产ts人妖一区二区| 国产精品久久久久久户外露出| 高清国产一区二区| 亚洲精品亚洲人成人网| 色综合亚洲欧洲| 亚洲国产精品一区二区久久 | 91美女片黄在线观看91美女| 国产精品色哟哟| 99久久久精品免费观看国产蜜| 国产精品国模大尺度视频| 91丨九色丨蝌蚪富婆spa| 亚洲男人的天堂一区二区| 欧美日韩亚洲综合在线 | 国产日韩v精品一区二区| 丁香五精品蜜臀久久久久99网站| 亚洲国产精品成人久久综合一区| 大陆成人av片| 亚洲一区二区不卡免费| 91精品国产乱码| 狠狠色丁香婷婷综合| 欧美激情一二三区| 欧美日韩美少妇| 国产在线观看一区二区| 国产精品久久久久久久岛一牛影视| 一本到不卡精品视频在线观看| 亚洲bt欧美bt精品| 欧美mv日韩mv国产| 色综合天天综合网天天看片| 强制捆绑调教一区二区| 国产精品美女一区二区| 8x8x8国产精品| 不卡一区二区中文字幕| 日韩在线一二三区| 国产精品欧美极品| 欧美一区二区视频在线观看2020| 国产精品456露脸| 亚洲自拍与偷拍| 国产精品欧美久久久久一区二区| 欧美日韩一二区| 99精品在线免费| 国产在线观看免费一区| 亚洲sss视频在线视频| 国产精品人人做人人爽人人添| 欧美日韩亚洲国产综合| 成人性生交大片免费看视频在线| 天堂蜜桃一区二区三区| 亚洲婷婷综合色高清在线| 日韩精品中文字幕一区二区三区| 91麻豆福利精品推荐| 精品亚洲免费视频| 日韩激情中文字幕| 亚洲色欲色欲www在线观看| 精品美女在线观看| 91麻豆精品国产自产在线观看一区 | 日本aⅴ免费视频一区二区三区| 综合色天天鬼久久鬼色| 国产欧美日韩亚州综合| 精品999在线播放| 欧美绝品在线观看成人午夜影视| 色综合欧美在线| 99在线精品免费| 成人av网址在线观看| 国产精品一二三| 国产另类ts人妖一区二区| 蜜桃在线一区二区三区| 爽好久久久欧美精品| 亚洲高清免费在线| 亚洲成在线观看| 亚洲成人一二三| 亚洲午夜精品在线| 亚洲一级不卡视频| 一区二区三区四区乱视频| 亚洲精选视频免费看| 亚洲欧洲综合另类| 亚洲免费观看高清在线观看| 国产精品女上位| 国产精品美女久久久久久久久久久| 中日韩av电影| 国产精品乱人伦一区二区| 欧美激情在线看| 国产精品久久毛片| 亚洲美女在线一区| 水野朝阳av一区二区三区| 日日骚欧美日韩| 日本大胆欧美人术艺术动态| 久久福利视频一区二区| 激情亚洲综合在线| 国产一区久久久| 成人午夜电影小说| 91日韩精品一区| 欧美精品久久天天躁| 欧美一二区视频| 国产欧美精品日韩区二区麻豆天美| 国产欧美一区二区精品久导航| 国产精品久久久久婷婷二区次| 亚洲免费av高清| 免费在线欧美视频| 国产精品一区二区久激情瑜伽| 国产99久久久国产精品免费看| 91亚洲男人天堂| 欧美裸体一区二区三区| 精品美女被调教视频大全网站| 久久精品视频免费| 亚洲精选视频免费看| 男女视频一区二区| 99久久免费国产| 欧美一区二区三区免费在线看| 2020国产精品自拍| 亚洲精品国产第一综合99久久| 午夜国产精品影院在线观看| 国产精品综合视频| 精品视频1区2区| 国产午夜精品久久| 日韩高清电影一区| 成人午夜激情视频| 2023国产精品视频| 天天av天天翘天天综合网 | 国产高清无密码一区二区三区| 91色九色蝌蚪| 精品成a人在线观看|