fortuna.c (fdafd315ad0d0f28a11b9fb4476a9ab059c62b92) fortuna.c (32fce09268ddd97efb4412529ba57293554c5985)
1/*-
2 * Copyright (c) 2017 W. Dean Freeman
3 * Copyright (c) 2013-2015 Mark R V Murray
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 57 unchanged lines hidden (view full) ---

66#include <dev/random/randomdev.h>
67#ifdef _KERNEL
68#include <dev/random/random_harvestq.h>
69#endif
70#include <dev/random/uint128.h>
71#include <dev/random/fortuna.h>
72
73/* Defined in FS&K */
1/*-
2 * Copyright (c) 2017 W. Dean Freeman
3 * Copyright (c) 2013-2015 Mark R V Murray
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 57 unchanged lines hidden (view full) ---

66#include <dev/random/randomdev.h>
67#ifdef _KERNEL
68#include <dev/random/random_harvestq.h>
69#endif
70#include <dev/random/uint128.h>
71#include <dev/random/fortuna.h>
72
73/* Defined in FS&K */
74#define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */
75#define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */
76#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes from AES before rekeying */
77#define RANDOM_FORTUNA_BLOCKS_PER_KEY (1 << 16) /* Max blocks from AES before rekeying */
78CTASSERT(RANDOM_FORTUNA_BLOCKS_PER_KEY * RANDOM_BLOCKSIZE ==
79 RANDOM_FORTUNA_MAX_READ);
80
81/*
82 * The allowable range of RANDOM_FORTUNA_DEFPOOLSIZE. The default value is above.
83 * Making RANDOM_FORTUNA_DEFPOOLSIZE too large will mean a long time between reseeds,

--- 734 unchanged lines hidden ---
74#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes from AES before rekeying */
75#define RANDOM_FORTUNA_BLOCKS_PER_KEY (1 << 16) /* Max blocks from AES before rekeying */
76CTASSERT(RANDOM_FORTUNA_BLOCKS_PER_KEY * RANDOM_BLOCKSIZE ==
77 RANDOM_FORTUNA_MAX_READ);
78
79/*
80 * The allowable range of RANDOM_FORTUNA_DEFPOOLSIZE. The default value is above.
81 * Making RANDOM_FORTUNA_DEFPOOLSIZE too large will mean a long time between reseeds,

--- 734 unchanged lines hidden ---