CTR, HASH and HMAC DRBGs in provider
authorPauli <paul.dale@oracle.com>
Fri, 8 May 2020 00:25:19 +0000 (10:25 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 24 Jun 2020 10:05:42 +0000 (20:05 +1000)
commitf000e82898af251442ca52e81fc1ee45996090dc
treeb378db85b032065a595ce8d7b0422981f09e0d58
parenta998b85a4f0e706fa6a07b7feab557d9e570d372
CTR, HASH and HMAC DRBGs in provider

Move the three different DRBGs to the provider.

As part of the move, the DRBG specific data was pulled out of a common
structure and into their own structures.  Only these smaller structures are
securely allocated.  This saves quite a bit of secure memory:

    +-------------------------------+
    | DRBG         | Bytes | Secure |
    +--------------+-------+--------+
    | HASH         |  376  |   512  |
    | HMAC         |  168  |   256  |
    | CTR          |  176  |   256  |
    | Common (new) |  320  |     0  |
    | Common (old) |  592  |  1024  |
    +--------------+-------+--------+

Bytes is the structure size on the X86/64.
Secure is the number of bytes of secure memory used (power of two allocator).

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/11682)
25 files changed:
crypto/evp/build.info
crypto/evp/evp_local.h
crypto/evp/evp_rand.c [new file with mode: 0644]
crypto/evp/rand_meth.c [deleted file]
crypto/rand/build.info
crypto/rand/drbg_lib.c
crypto/rand/rand_lib.c
crypto/rand/rand_local.h
doc/man3/RAND_DRBG_new.pod
doc/man3/RAND_DRBG_set_callbacks.pod
include/openssl/core_names.h
include/openssl/core_numbers.h
include/openssl/evp.h
include/openssl/rand.h
include/openssl/rand_drbg.h
providers/defltprov.c
providers/fips/fipsprov.c
providers/implementations/rands/build.info
providers/implementations/rands/crngt.c
providers/implementations/rands/drbg.c
providers/implementations/rands/drbg_ctr.c
providers/implementations/rands/drbg_hash.c
providers/implementations/rands/drbg_hmac.c
providers/implementations/rands/drbg_local.h
providers/implementations/rands/test_rng.c