kernel/src/crypto/Random.h
/**
         * Generate a block of data; the counter is incremented as well.
         *
         * @param scratch A buffer at least AES_BLOCKLEN bytes in size; you should zero this when
         *        the calling function is done.
         * @param ptr Buffer to copy the generated block into.
         * @param bytes Number of bytes to copy out; must be at most AES_BLOCKLEN
         */
Generate a block of data; the counter is incremented as well.
@param scratch A buffer at least AES_BLOCKLEN bytes in size; you should zero this when
the calling function is done.
@param ptr Buffer to copy the generated block into.
@param bytes Number of bytes to copy out; must be at most AES_BLOCKLEN
Generate a block of data ; the counter is incremented as well . @param scratch A buffer at least AES_BLOCKLEN bytes in size ; you should zero this when the calling function is done . @param ptr Buffer to copy the generated block into . @param bytes Number of bytes to copy out ; must be at most AES_BLOCKLEN
inline void generateBlock(uint8_t *scratch, void *ptr, const size_t bytes) {
            memcpy(scratch, this->counter, AES_BLOCKLEN);
            AES_CTR_xcrypt_buffer(&this->aesCtx, scratch, AES_BLOCKLEN);
            memcpy(ptr, scratch, bytes);
            ++(*this);
        }
inline void generateBlock ( uint8_t * scratch , void * ptr , const size_t bytes ) { memcpy ( scratch , this -> counter , AES_BLOCKLEN ) ; AES_CTR_xcrypt_buffer ( & this -> aesCtx , scratch , AES_BLOCKLEN ) ; memcpy ( ptr , scratch , bytes ) ; ++ ( * this ) ; }
Generate a block of data; the counter is incremented as well.
Generate a block of data ; the counter is incremented as well .
// increment counter