X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=entropium.h;h=7b4081e1971c819eaadd68e40f851900ed22fcd8;hb=4d76909e4282baf1420ee309e270384246b241b8;hp=02aa3172faf3d5146a4b57bbb344c6a7947a3c52;hpb=96ebafd201c9e8441c7677577b24aa402c1defc6;p=avr-crypto-lib.git diff --git a/entropium.h b/entropium.h index 02aa317..7b4081e 100644 --- a/entropium.h +++ b/entropium.h @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + /** * File: entropium.h * Author: Daniel Otte @@ -24,6 +25,15 @@ * Description: This file contains the declarations for the pseudo-random-number generator. **/ +/** + * \file entropium.h + * \author Daniel Otte + * \date 23.07.2006 + * \license GPLv3 or later + * \brief This file contains the declarations for the pseudo-random-number generator. + **/ + + #ifndef ENTROPIUM_H_ #define ENTROPIUM_H_ @@ -33,11 +43,42 @@ */ #define ENTROPIUM_RANDOMBLOCK_SIZE 32 /* bytes */ +/** \fn void entropium_addEntropy(unsigned length_b, const void* data) + * \brief add entropy to the prng + * + * This function adds data to the internal entropy pool + * \param length_b length of the data block in bits + * \param data pointer to the data + */ void entropium_addEntropy(unsigned length_b, const void* data); + +/** \fn void entropium_getRandomBlock(void* b) + * \brief generate a fixed size block of random data + * + * This function writes 32 bytes of random extracted from the entropy pool + * in the supplied buffer. + * \param b buffer where the random data gets written + */ void entropium_getRandomBlock(void* b); -/* this does some simple buffering */ + +/** \fn uint8_t entropium_getRandomByte(void) + * \brief get a single byte of random data + * + * This function utilizes a internal buffer which gets automatically filled + * again. + * \return a byte of random data + */ uint8_t entropium_getRandomByte(void); +/** \fn void entropium_fillBlockRandom(void* block, unsigned length_B) + * \brief get a block of random data + * + * This function writes random data extracted from the entropy pool in the + * supplied buffer. It shares a internal buffer with the + * entropium_getRandomByte() function. + * \param block pointer to the buffer where the random data goes + * \param length_B number of bytes to be written to the buffer + */ void entropium_fillBlockRandom(void* block, unsigned length_B); #endif /*PRNG_H_*/