[PATCH 0/2] SP800-90A DRBG

Werner Koch wk at gnupg.org
Fri Feb 19 15:58:30 CET 2016


On Wed, 17 Feb 2016 18:30, smueller at chronox.de said:

> The question is what kind of support do you want to have with the DRBG. The
> implementation in the patch includes all bells and whistles defined in
> SP800-90A. The following listing enumerates options which may be removed from
> the current implementation:

Thanks for the list.  Meanwhile I hacked a bit on the code and I kept
all algorithms except that SHA384 is not anymore accessible (does that
make sense at all?)

> - remove support for additional information
>
> - remove support for personalization string

Keeping this would require a new API call.  I do not really like the
clever overloading trick fro gcry_randomize.  However the code is still
tehre and could be added in the future.

> - remove reseed support

I kept this one but with a change to the gcry_control API: Now a
gcry_buffer_t is used instead of your internal string type.  To use this
one can do:

  char pers_string[] = "I'm a doctor, not an engineer.";
  gcry_buffer_t pers[1];

  memset (pers, 0, sizeof pers);
  pers[0].data = pers_string;
  pers[0].len = strlen (pers_string);

  err = gcry_control (GCRYCTL_DRBG_REINIT, "aes sym128 pr", pers, 1, NULL);

This also shows the use of the new API.  tests/random.c has a couple of
tests for that API.  

I also introduced a new gcrypt-testapi.h file which can be used for
example by tests/fipsdrv.c to run the tests.  That header also declares
the test vector struct.

Thanks for your contribution - I hope I did not broke too much.


Salam-Shalom,

   Werner




More information about the Gcrypt-devel mailing list