+/**
+ * Get \param n_byte from entropy pool. If n_byte is larger than number
+ * byte of entropy in entropy pool, randpool_get continue
+ * to generate pseudocasual value from previous state of
+ * pool.
+ * \param n_byte number fo bytes to read.
+ * \param pool is the pool entropy context.
+ * \param _data is the pointer to write the random data to.
+ */
+void randpool_get(EntropyPool *pool, void *_data, size_t n_byte)
+{
+ Md2Context context;
+ size_t i = pool->pos_get;
+ size_t n = n_byte;
+ size_t pos_write = 0; //Number of block has been written in data.
+ size_t len = MIN((size_t)MD2_DIGEST_LEN, n_byte);
+ uint8_t *data;
+
+ data = (uint8_t *)_data;
+
+ /* Test if i + CONFIG_MD2_BLOCK_LEN is inside of entropy pool.*/
+ ASSERT((MD2_DIGEST_LEN + i) < CONFIG_SIZE_ENTROPY_POOL);
+
+ md2_init(&context);
+
+ while(n > 0)
+ {
+
+ /*Hash previous state of pool*/
+ md2_update(&context, &pool->pool_entropy[i], MD2_DIGEST_LEN);
+
+ memcpy(&data[pos_write], md2_end(&context), len);
+
+ pos_write += len; //Update number of block has been written in data.
+ n -= len; //Number of byte copied in data.
+
+ len = MIN(n,(size_t)MD2_DIGEST_LEN);
+
+ i = (i + MD2_DIGEST_LEN) % CONFIG_SIZE_ENTROPY_POOL;
+
+ /* If we haven't more entropy pool to hash, we stir it.*/
+ if(i < MD2_DIGEST_LEN)
+ {
+ randpool_stir(pool);
+ i = pool->pos_get;
+ }
+
+ }
+
+ pool->pos_get = i; //Current number of byte we get from pool.
+ pool->entropy -= n_byte; //Update a entropy.
+
+ /*If we get all entropy entropy is 0*/
+ if(pool->entropy < 0)
+ pool->entropy = 0;
+
+}
+
+/**
+ * Return a pointer to entropy pool.
+ */
+uint8_t *randpool_pool(EntropyPool *pool)