static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
#include <crypto/internal/rng.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/string.h>
#define DEFAULT_PRNG_KEY "0123456789abcdef"
#define DEFAULT_PRNG_KSZ 16
#define DEFAULT_BLK_SZ 16
#define DEFAULT_V_SEED "zaybxcwdveuftgsh"
#define PRNG_FIXED_SIZE 0x1
#define PRNG_NEED_RESET 0x2
unsigned char rand_data[DEFAULT_BLK_SZ];
unsigned char last_rand_data[DEFAULT_BLK_SZ];
unsigned char DT[DEFAULT_BLK_SZ];
unsigned char I[DEFAULT_BLK_SZ];
unsigned char V[DEFAULT_BLK_SZ];
struct crypto_cipher *tfm;
static void hexdump(char *note, unsigned char *buf, unsigned int len)
printk(KERN_CRIT "%s", note);
print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
#define dbgprint(format, args...) do {\
static void xor_vectors(unsigned char *in1, unsigned char *in2,
unsigned char *out, unsigned int size)
for (i = 0; i < size; i++)
out[i] = in1[i] ^ in2[i];
static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test)
unsigned char tmp[DEFAULT_BLK_SZ];
unsigned char *output = NULL;