{
    "content": [
        {
            "type": "text",
            "text": "# EVP_RAND-CTR-DRBG (man)\n\n## NAME\n\nEVPRAND-CTR-DRBG - The CTR DRBG EVPRAND implementation\n\n## DESCRIPTION\n\nSupport for the counter deterministic random bit generator through the EVPRAND API.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **NOTES**\n- **EXAMPLES**\n- **CONFORMING TO**\n- **SEE ALSO**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "EVP_RAND-CTR-DRBG",
        "section": "",
        "mode": "man",
        "summary": "EVPRAND-CTR-DRBG - The CTR DRBG EVPRAND implementation",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "EVPRAND *rand;",
            "EVPRANDCTX *rctx;",
            "unsigned char bytes[100];",
            "OSSLPARAM params[2], *p = params;",
            "unsigned int strength = 128;",
            "rand = EVPRANDfetch(NULL, \"CTR-DRBG\", NULL);",
            "rctx = EVPRANDCTXnew(rand, NULL);",
            "EVPRANDfree(rand);",
            "*p++ = OSSLPARAMconstructutf8string(OSSLDRBGPARAMCIPHER,",
            "SNaes256ctr, 0);",
            "*p = OSSLPARAMconstructend();",
            "EVPRANDinstantiate(rctx, strength, 0, NULL, 0, params);",
            "EVPRANDgenerate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);",
            "EVPRANDCTXfree(rctx);"
        ],
        "see_also": [
            {
                "name": "EVPRAND",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPRAND/3/json"
            },
            {
                "name": "EVPRAND",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPRAND/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "EVPRAND-CTR-DRBG - The CTR DRBG EVPRAND implementation\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Support for the counter deterministic random bit generator through the EVPRAND API.\n\nIdentity\n\"CTR-DRBG\" is the name for this implementation; it can be used with the EVPRANDfetch()\nfunction.\n\nSupported parameters\nThe supported parameters are:\n\n\"state\" (OSSLRANDPARAMSTATE) <integer>\n\"strength\" (OSSLRANDPARAMSTRENGTH) <unsigned integer>\n\"maxrequest\" (OSSLRANDPARAMMAXREQUEST) <unsigned integer>\n\"reseedrequests\" (OSSLDRBGPARAMRESEEDREQUESTS) <unsigned integer>\n\"reseedtimeinterval\" (OSSLDRBGPARAMRESEEDTIMEINTERVAL) <integer>\n\"minentropylen\" (OSSLDRBGPARAMMINENTROPYLEN) <unsigned integer>\n\"maxentropylen\" (OSSLDRBGPARAMMAXENTROPYLEN) <unsigned integer>\n\"minnoncelen\" (OSSLDRBGPARAMMINNONCELEN) <unsigned integer>\n\"maxnoncelen\" (OSSLDRBGPARAMMAXNONCELEN) <unsigned integer>\n\"maxperslen\" (OSSLDRBGPARAMMAXPERSLEN) <unsigned integer>\n\"maxadinlen\" (OSSLDRBGPARAMMAXADINLEN) <unsigned integer>\n\"reseedcounter\" (OSSLDRBGPARAMRESEEDCOUNTER) <unsigned integer>\n\"properties\" (OSSLDRBGPARAMPROPERTIES) <UTF8 string>\n\"cipher\" (OSSLDRBGPARAMCIPHER) <UTF8 string>\nThese parameters work as described in \"PARAMETERS\" in EVPRAND(3).\n\n\"usederivationfunction\" (OSSLDRBGPARAMUSEDF) <integer>\nThis Boolean indicates if a derivation function should be used or not.  A nonzero value\n(the default) uses the derivation function.  A zero value does not.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "A context for CTR DRBG can be obtained by calling:\n\nEVPRAND *rand = EVPRANDfetch(NULL, \"CTR-DRBG\", NULL);\nEVPRANDCTX *rctx = EVPRANDCTXnew(rand);\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "EVPRAND *rand;\nEVPRANDCTX *rctx;\nunsigned char bytes[100];\nOSSLPARAM params[2], *p = params;\nunsigned int strength = 128;\n\nrand = EVPRANDfetch(NULL, \"CTR-DRBG\", NULL);\nrctx = EVPRANDCTXnew(rand, NULL);\nEVPRANDfree(rand);\n\n*p++ = OSSLPARAMconstructutf8string(OSSLDRBGPARAMCIPHER,\nSNaes256ctr, 0);\n*p = OSSLPARAMconstructend();\nEVPRANDinstantiate(rctx, strength, 0, NULL, 0, params);\n\nEVPRANDgenerate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);\n\nEVPRANDCTXfree(rctx);\n",
                "subsections": []
            },
            "CONFORMING TO": {
                "content": "NIST SP 800-90A and SP 800-90B\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "EVPRAND(3), \"PARAMETERS\" in EVPRAND(3)\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a copy in the file LICENSE in the source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n3.0.2                                       2026-06-02                    EVPRAND-CTR-DRBG(7SSL)",
                "subsections": []
            }
        }
    }
}