diff options
author | Werner Koch <wk@gnupg.org> | 2016-02-18 17:51:34 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-02-19 14:35:29 +0100 |
commit | dfac2b13d0068b2b1b420d77e9771a49964b81c1 (patch) | |
tree | 8e21474b236fc9219450aefb643d6d9116787b1a /src/gcrypt.h.in | |
parent | 4e134b6e77f558730ec1eceb6b816b0bcfd845e9 (diff) | |
download | libgcrypt-dfac2b13d0068b2b1b420d77e9771a49964b81c1.tar.gz |
random: Remove the new API introduced by the new DRBG.
* src/gcrypt.h.in (struct gcry_drbg_gen): Move to random/drbg.c.
(struct gcry_drbg_string): Ditto.
(gcry_drbg_string_fill): Ditto.
(gcry_randomize_drbg): Remove.
* random/drbg.c (parse_flag_string): New.
(_gcry_drbg_reinit): Change the way the arguments are passed.
* src/global.c (_gcry_vcontrol) <GCRYCTL_DRBG_REINIT>: Change calling
convention.
--
It does not make sense to extend the API for a somewhat questionable
feature. For GCRYCTL_DRBG_REINIT we change to use a string with flags
and libgcrypt's native buffer data structure.
NB: GCRYCTL_DRBG_REINIT has not been tested!
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gcrypt.h.in')
-rw-r--r-- | src/gcrypt.h.in | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index 23b09690..f48f04fb 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -1722,54 +1722,6 @@ int gcry_is_secure (const void *a) _GCRY_GCC_ATTR_PURE; /* Return true if Libgcrypt is in FIPS mode. */ #define gcry_fips_mode_active() !!gcry_control (GCRYCTL_FIPS_MODE_P, 0) -/* DRBG input data structure for DRBG generate with additional information - * string */ -struct gcry_drbg_gen -{ - unsigned char *outbuf; /* output buffer for random numbers */ - unsigned int outlen; /* size of output buffer */ - struct gcry_drbg_string *addtl; /* input buffer for - * additional information string */ -}; - -/* - * Concatenation Helper and string operation helper - * - * SP800-90A requires the concatenation of different data. To avoid copying - * buffers around or allocate additional memory, the following data structure - * is used to point to the original memory with its size. In addition, it - * is used to build a linked list. The linked list defines the concatenation - * of individual buffers. The order of memory block referenced in that - * linked list determines the order of concatenation. - */ -/* DRBG string definition */ -struct gcry_drbg_string -{ - const unsigned char *buf; - size_t len; - struct gcry_drbg_string *next; -}; - -static inline void gcry_drbg_string_fill(struct gcry_drbg_string *string, - const unsigned char *buf, size_t len) -{ - string->buf = buf; - string->len = len; - string->next = NULL; -} - -/* this is a wrapper function for users of libgcrypt */ -static inline void gcry_randomize_drbg(void *outbuf, size_t outlen, - enum gcry_random_level level, - struct gcry_drbg_string *addtl) -{ - struct gcry_drbg_gen genbuf; - genbuf.outbuf = (unsigned char *)outbuf; - genbuf.outlen = outlen; - genbuf.addtl = addtl; - gcry_randomize(&genbuf, 0, level); -} - #if 0 /* (Keep Emacsens' auto-indent happy.) */ { |