[#RAND_set_DRBG_type]
= RAND&lowbar;set&lowbar;DRBG&lowbar;type
:mrdocs:

Configure the primary DRBG algorithm type for a library context&period;

== Synopsis

Declared in `&lt;openssl&sol;rand&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
RAND&lowbar;set&lowbar;DRBG&lowbar;type(
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* ctx,
    char const* drbg,
    char const* propq,
    char const* cipher,
    char const* digest);
----

== Description

Must be called before the DRBGs are first instantiated for `ctx&period;`

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Library context whose RNG is configured, or NULL for the default&period;
| *drbg*
| DRBG algorithm name (for example &quot;HASH&hyphen;DRBG&quot; or &quot;CTR&hyphen;DRBG&quot;), or NULL for the default&period;
| *propq*
| Property query for fetching the DRBG, or NULL&period;
| *cipher*
| Cipher name required by CTR&hyphen;DRBG, or NULL when unused&period;
| *digest*
| Digest name required by HASH&hyphen;DRBG&sol;HMAC&hyphen;DRBG, or NULL when unused&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
