| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
RandomNumberGenerator, and make ANSI_X931_PRNG's implementations just
forward the arguments to the underlying RNG. This allows seeding the RNG
even if no entropy modules are loaded into the library. Also it allows
actually adding user-specified data; to do it otherwise would require
creating the RNG objects yourself and retaining a pointer to the Randpool,
which is pretty bogus.
Move Null_RNG to rng.h
|
| |
|
|
|
|
|
|
|
| |
Randpool, it will query them as needed (or if asked to do so). New function
make_rng() that creates an RNG (X9.31 backed by a Randpool) and seeds it.
Remove the entropy source related code from the Modules/Builtin_Modules
classes.
|
|
|
|
|
|
| |
They were probably not a good idea. If nothing else, these functions might
throw bad_alloc, and possibly other errors. Something broad like std::exception
might be applicable, but that seems pointlessly broad.
|
| |
|
|
|
|
|
|
| |
length to zero. That is because we encoded our seededness state as being
if (and only if) V has non-zero length. After clearing, we have reset all
state.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it was seeded if and only if the underlying PRNG was seeded. However if
the PRNG always returned as being seeded, we would never generate a V
value, etc (leaving them at the default zero). This would not occur with
any of Botan's built in PRNGs since their implementations require that
add_randomness be called at least once before is_seeded will return true.
However this is not an invariant of the general RandomNumberGenerator
interface.
Now, the X9.31 PRNG is only seeded after it has a) detected that the PRNG
is seeded, and b) generated a new random key and V vector.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the second argument was NULL, it would default to a new Randpool.
But this introduces an annoying dependency: really it is the caller who
is relying on Randpool. Make this explicit by passing a new Randpool
pointer to the constructor in Library_State.
This will break all callers using ANSI_X931_RNG's constructors with
default arguments. To regain the previous behavior, change:
ANSI_X931_RNG rng;
ANSI_X931_RNG rng("/*cipher name*/");
to
ANSI_X931_RNG rng(/*cipher name, default was AES-256 */, new Randpool);
You are free to pass another PRNG object if you like.
This make require inclusion of <botan/randpool.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
block of data in the X9.31 PRNG (previously, adding entropy would cause
a new block to be computed but the read pointer would be the same as it
had been in the old block). Nominally this is very slightly faster (we
don't throw away bytes we just computed) but the change is more to make
the code more obvious/explicit; I was surprised by its old behavior, which
seems bad.
In theory it could introduce additional weaknesses, if gaining advantage
to this partial block that was being thrown away assisted in an attack
(I do not know of any attacks against the X9.31 PRNG that work that way,
however).
|
|
|
|
|
|
| |
the actual copyright holders. For rationale, see my post to botan-devel
on April 9, subject 'Changing license to directly reflect contributors'
(http://www.randombit.net/pipermail/botan-devel/2008-April/000527.html)
|
|
|
|
|
| |
updated dates on files that have actually changed this year. This makes
the diff across versions readable again.
|
|
|
|
|
|
|
| |
but might as well keep it up to date. And it's easier to do it once with
a 'perl -pi' command than to update each file over time.
Apologies to anyone looking at diffs.
|
| |
|
|
|