⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 assumptions

📁 SIP(Session Initiation Protocol)是由IETF定义
💻
字号:
Assumptions===========The Yarrow design, described in "Yarrow-160: Notes on the Design andAnalysis of the Yarrow Cryptographic Pseudonumber Generator" by JohnKelsey, Bruce Schneier and Niels Ferguson of Counterpane Systems(available from http://www.counterpane.com/yarrow.html), left out someimplementation details and has some ambiguities in the protocol.  ZKShas to made some assumptions and taken some decisions in itsimplementation of Yarrow. In the text, `we' represents ZKS.Here is the list of those assumptions: 1) To simplify the code and speed up running time, we limit the numberof different sources to 20. This should be enough for mostapplications. This can be changed by redefining YARROW_MAX_SOURCE inyarrow.h.2) The Yarrow paper (in section 5.3) state that Pt is eitherimplementation dependent or dynamically adjusted. We chose to fix theslow pool's Pt to 100 and the fast pool's Pt to 10. This can bechanged by redefining YARROW_FAST_PT and YARROW_SLOW_PT in yarrow.c.3) Initialization when there is no saved state is not discussed in theYarrow paper.  We have defined that CPRNG is becomes seeded after aslow reseed.  During initialization, a slow reseed is triggered byYARROW_K_OF_N_INIT_THRESH sources reaching the slow thresholdYARROW_SLOW_INIT_THRESH.  During initialization, fast reseeds aretriggered when a source reaches the fast thresholdYARROW_FAST_INIT_THRESH.  After reseed the behavior of the pools iscontrolled by YARROW_K_OF_N_THRESH, YARROW_SLOW_THRESH andYARROW_FAST_THRESH.  Our default values for YARROW_K_OF_N_INIT_THRESH,YARROW_SLOW_INIT_THRESH and YARROW_FAST_INIT_THRESH are the same asYARROW_K_OF_N_THRESH, YARROW_SLOW_THRESH and YARROW_FAST_THRESHrespectively.  Note this means that a Yarrow_Poll call by itself cannever put us in an initialized state, as it only works on one pool,and the default YARROW_K_OF_N_INIT_THRESH value is 2.4) We define a function Yarrow_Poll which can gather entropy.  Theuser must allocate a source_id, and call Yarrow_Poll manually.Yarrow_Poll just adds samples from the machines state to the sourcegiven as an argument.5) Prior to initialization, Yarrow_Output will fail.6) The actions to take on state load are not described in the yarrowpaper, all it says is that 2k bytes should be written (and byimplication read back in somehow).  We read in the 2k bytes, hashthem into the fast pool, and then do a forced fast reseed, and animmediate state save.7) In step 2 of the reseed process, we must hash the value i. Therepresentation of this integer will affect the hash value. In ourcode, i is a 64-bit unsigned value. We update the hash context usingthe 64 bit big endian representation of i.8) Yarrow outputs random bits in blocks. If the calling functionrequests less bits than available, then the unused bits are keptin memory until the next call. In case of a reseed, we chose to discard those leftover bits.9) The samples from one source must alternate between the two pools.As a default, we initialize the first pool to send the sample too tobe the fast pool. This initialization is done only when a source isadded, not when we reseed from one.10) The Yarrow paper states that the maximum number of outputs betweenreseeding is limited to min(2^n,2^(k/3)*Pg), but does not explainwhat is to happen when this limit is reached. It could be the casethat we reach the limit but there is not enough entropy in the pools to reseed. In our code, the Yarrow_Output_Block will do a forcedfast reseed. 11) In the Yarrow paper, the limit on the number of outputs betweenreseeding is expressed in number of outputs:#oututs <= min(2^n, 2^(k/3).Pg)but we redefine it in terms of gates by dividing the numbers by Pg,the number of outputs per gate, and counting the number of gatesinstead.  This makes an overflow a little less likely.We don't use a bignum library, so in event of overflow, the limit innumber of gates before reseed (y->gates_limit) is reduced down to2^64-1 (or 2^32-1 if 64 bit ints aren't available on the platform).12) The Yarrow paper describes that the cipher block C should be incremented as part of the output function.  We treat the bytesof C as a big endian number to do the increment.13) Triple-DES key size.  The yarrow paper uses the letter k torepresent the keysize in bits.  Due to the parity bits, the size of kis 192 bits.  However the effective key size is actually 168 bits, asthe value of k is used in security limits, k must be 168 bits.  Thepaper uses k (eg set K to the next k output bits), so we have to dothe parity padding function, to copy bits 0-6 to 0-7, 7-13 to 8-15etc.  The macro DES_Init performs the function of doing a DES keyschedule from a packed key (no parity bits), internally doing theparity padding.  Other ciphers are simpler as there is no parity.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -