pike.git / src / post_modules / Nettle / nettle.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/nettle.cmod:34:    *!    *! Yarrow is a family of pseudo-randomness generators, designed for    *! cryptographic use, by John Kelsey, Bruce Schneier and Niels Ferguson.    *! Yarrow-160 is described in a paper at    *! @url{http://www.schneier.com/paper-yarrow.html@}, and it uses SHA1 and    *! triple-DES, and has a 160-bit internal state. Nettle implements    *! Yarrow-256, which is similar, but uses SHA256 and AES to get an    *! internal state of 256 bits.    */   PIKECLASS Yarrow + program_flags PROGRAM_CLEAR_STORAGE;   {    CVAR struct yarrow256_ctx ctx;    CVAR struct yarrow_source *sources;       DECLARE_STORAGE;       /*! @decl void create(void|int sources)    *! The number of entropy sources that will feed entropy to the    *! random number generator is given as an argument to Yarrow    *! during instantiation.
pike.git/src/post_modules/Nettle/nettle.cmod:248:    *! Bruce Schneier and described in Practical Cryptography. Web    *! published exerpt at https://www.schneier.com:443/fortuna.pdf    *!    *! This implementation uses AES256 to generate output and SHA256 to    *! generate keys.    *!    *! To use this class an entropy accumulator needs to be implemented    *! and supply the @[reseed()] method with new entopy.    */   PIKECLASS Fortuna + program_flags PROGRAM_CLEAR_STORAGE;   {    CVAR struct aes_ctx aes_ctx;    CVAR struct sha256_ctx sha_ctx;    CVAR uint8_t *key;    CVAR uint8_t *ctr;    CVAR uint8_t *data;       DECLARE_STORAGE;      #ifndef AES256_KEY_SIZE