Lines Matching refs:pImpl
65 static double __rtl_random_data (RandomData_Impl *pImpl);
86 RandomPool_Impl *pImpl);
91 RandomPool_Impl *pImpl, const sal_uInt8 *pBuffer, sal_Size nBufLen);
96 RandomPool_Impl *pImpl, sal_uInt8 *pBuffer, sal_Size nBufLen);
101 static double __rtl_random_data (RandomData_Impl *pImpl) in __rtl_random_data() argument
105 RTL_RANDOM_RNG (pImpl->m_nX, pImpl->m_nY, pImpl->m_nZ); in __rtl_random_data()
106 random = (((double)(pImpl->m_nX) / 30328.0) + in __rtl_random_data()
107 ((double)(pImpl->m_nY) / 30269.0) + in __rtl_random_data()
108 ((double)(pImpl->m_nZ) / 30307.0) ); in __rtl_random_data()
117 static sal_Bool __rtl_random_initPool (RandomPool_Impl *pImpl) in __rtl_random_initPool() argument
119 pImpl->m_hDigest = rtl_digest_create (RTL_RANDOM_DIGEST); in __rtl_random_initPool()
120 if (pImpl->m_hDigest) in __rtl_random_initPool()
140 __rtl_random_seedPool (pImpl, (sal_uInt8*)&id, sizeof(id)); in __rtl_random_initPool()
145 __rtl_random_seedPool (pImpl, (sal_uInt8*)&tv, sizeof(tv)); in __rtl_random_initPool()
150 __rtl_random_seedPool (pImpl, (sal_uInt8*)&rd, sizeof(rd)); in __rtl_random_initPool()
152 while (pImpl->m_nData < RTL_RANDOM_SIZE_POOL) in __rtl_random_initPool()
155 __rtl_random_seedPool (pImpl, (sal_uInt8*)&seed, sizeof(seed)); in __rtl_random_initPool()
166 RandomPool_Impl *pImpl, const sal_uInt8 *pBuffer, sal_Size nBufLen) in __rtl_random_seedPool() argument
178 pImpl->m_hDigest, pImpl->m_pDigest, RTL_RANDOM_SIZE_DIGEST); in __rtl_random_seedPool()
180 k = (pImpl->m_nIndex + j) - RTL_RANDOM_SIZE_POOL; in __rtl_random_seedPool()
184 pImpl->m_hDigest, &(pImpl->m_pData[pImpl->m_nIndex]), j - k); in __rtl_random_seedPool()
186 pImpl->m_hDigest, &(pImpl->m_pData[0]), k); in __rtl_random_seedPool()
191 pImpl->m_hDigest, &(pImpl->m_pData[pImpl->m_nIndex]), j); in __rtl_random_seedPool()
194 rtl_digest_update (pImpl->m_hDigest, pBuffer, j); in __rtl_random_seedPool()
198 pImpl->m_hDigest, pImpl->m_pDigest, RTL_RANDOM_SIZE_DIGEST); in __rtl_random_seedPool()
201 pImpl->m_pData[pImpl->m_nIndex++] ^= pImpl->m_pDigest[k]; in __rtl_random_seedPool()
202 if (pImpl->m_nIndex >= RTL_RANDOM_SIZE_POOL) in __rtl_random_seedPool()
204 pImpl->m_nData = RTL_RANDOM_SIZE_POOL; in __rtl_random_seedPool()
205 pImpl->m_nIndex = 0; in __rtl_random_seedPool()
210 if (pImpl->m_nIndex > pImpl->m_nData) in __rtl_random_seedPool()
211 pImpl->m_nData = pImpl->m_nIndex; in __rtl_random_seedPool()
218 RandomPool_Impl *pImpl, sal_uInt8 *pBuffer, sal_Size nBufLen) in __rtl_random_readPool() argument
230 pImpl->m_hDigest, in __rtl_random_readPool()
231 &(pImpl->m_pDigest[RTL_RANDOM_SIZE_DIGEST/2]), in __rtl_random_readPool()
234 k = (pImpl->m_nIndex + j) - pImpl->m_nData; in __rtl_random_readPool()
238 pImpl->m_hDigest, &(pImpl->m_pData[pImpl->m_nIndex]), j - k); in __rtl_random_readPool()
240 pImpl->m_hDigest, &(pImpl->m_pData[0]), k); in __rtl_random_readPool()
245 pImpl->m_hDigest, &(pImpl->m_pData[pImpl->m_nIndex]), j); in __rtl_random_readPool()
249 pImpl->m_hDigest, pImpl->m_pDigest, RTL_RANDOM_SIZE_DIGEST); in __rtl_random_readPool()
252 if (pImpl->m_nIndex >= pImpl->m_nData) pImpl->m_nIndex = 0; in __rtl_random_readPool()
253 pImpl->m_pData[pImpl->m_nIndex++] ^= pImpl->m_pDigest[k]; in __rtl_random_readPool()
254 *pBuffer++ = pImpl->m_pDigest[k + RTL_RANDOM_SIZE_DIGEST/2]; in __rtl_random_readPool()
258 pImpl->m_nCount++; in __rtl_random_readPool()
260 pImpl->m_hDigest, &(pImpl->m_nCount), sizeof(pImpl->m_nCount)); in __rtl_random_readPool()
262 pImpl->m_hDigest, pImpl->m_pDigest, RTL_RANDOM_SIZE_DIGEST); in __rtl_random_readPool()
264 pImpl->m_hDigest, pImpl->m_pDigest, RTL_RANDOM_SIZE_DIGEST); in __rtl_random_readPool()
277 RandomPool_Impl *pImpl = (RandomPool_Impl*)NULL; in rtl_random_createPool() local
278 pImpl = (RandomPool_Impl*)rtl_allocateZeroMemory (sizeof(RandomPool_Impl)); in rtl_random_createPool()
279 if (pImpl) in rtl_random_createPool()
281 if (!__rtl_random_initPool (pImpl)) in rtl_random_createPool()
283 rtl_freeZeroMemory (pImpl, sizeof(RandomPool_Impl)); in rtl_random_createPool()
284 pImpl = (RandomPool_Impl*)NULL; in rtl_random_createPool()
287 return ((rtlRandomPool)pImpl); in rtl_random_createPool()
295 RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; in rtl_random_destroyPool() local
296 if (pImpl) in rtl_random_destroyPool()
298 rtl_digest_destroy (pImpl->m_hDigest); in rtl_random_destroyPool()
299 rtl_freeZeroMemory (pImpl, sizeof (RandomPool_Impl)); in rtl_random_destroyPool()
309 RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; in rtl_random_addBytes() local
312 if ((pImpl == NULL) || (pBuffer == NULL)) in rtl_random_addBytes()
315 __rtl_random_seedPool (pImpl, pBuffer, Bytes); in rtl_random_addBytes()
325 RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; in rtl_random_getBytes() local
328 if ((pImpl == NULL) || (pBuffer == NULL)) in rtl_random_getBytes()
331 __rtl_random_readPool (pImpl, pBuffer, Bytes); in rtl_random_getBytes()