{
    "mode": "man",
    "parameter": "EVP_RAND-SEED-SRC",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/EVP_RAND-SEED-SRC/7/json",
    "generated": "2026-10-09T12:55:17Z",
    "sections": {
        "NAME": {
            "content": "EVPRAND-SEED-SRC - The randomness seed source EVPRAND implementation\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Support for deterministic random number generator seeding through the EVPRAND API.\n\nThe seed sources used are specified at the time OpenSSL is configured for building using the\n--with-rand-seed= option.  By default, operating system randomness sources are used.\n",
            "subsections": [
                {
                    "name": "Identity",
                    "content": "\"SEED-SRC\" is the name for this implementation; it can be used with the EVPRANDfetch()\nfunction.\n"
                },
                {
                    "name": "Supported parameters",
                    "content": "The supported parameters are:\n\n\"state\" (OSSLRANDPARAMSTATE) <integer>\n\"strength\" (OSSLRANDPARAMSTRENGTH) <unsigned integer>\n\"maxrequest\" (OSSLRANDPARAMMAXREQUEST) <unsigned integer>\nThese parameters work as described in \"PARAMETERS\" in EVPRAND(3).\n"
                }
            ]
        },
        "NOTES": {
            "content": "A context for the seed source can be obtained by calling:\n\nEVPRAND *rand = EVPRANDfetch(NULL, \"SEED-SRC\", NULL);\nEVPRANDCTX *rctx = EVPRANDCTXnew(rand);\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "EVPRAND *rand;\nEVPRANDCTX *seed, *rctx;\nunsigned char bytes[100];\nOSSLPARAM params[2], *p = params;\nunsigned int strength = 128;\n\n/* Create and instantiate a seed source */\nrand = EVPRANDfetch(NULL, \"SEED-SRC\", NULL);\nseed = EVPRANDCTXnew(rand, NULL);\nEVPRANDinstantiate(seed, strength, 0, NULL, 0, NULL);\nEVPRANDfree(rand);\n\n/* Feed this into a DRBG */\nrand = EVPRANDfetch(NULL, \"CTR-DRBG\", NULL);\nrctx = EVPRANDCTXnew(rand, seed);\nEVPRANDfree(rand);\n\n/* Configure the DRBG */\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);\nEVPRANDCTXfree(seed);\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.13                                       2026-07-29                      EVPRAND-SEED-SRC(7SSL)",
            "subsections": []
        }
    },
    "summary": "EVPRAND-SEED-SRC - The randomness seed source EVPRAND implementation",
    "flags": [],
    "examples": [
        "EVPRAND *rand;",
        "EVPRANDCTX *seed, *rctx;",
        "unsigned char bytes[100];",
        "OSSLPARAM params[2], *p = params;",
        "unsigned int strength = 128;",
        "/* Create and instantiate a seed source */",
        "rand = EVPRANDfetch(NULL, \"SEED-SRC\", NULL);",
        "seed = EVPRANDCTXnew(rand, NULL);",
        "EVPRANDinstantiate(seed, strength, 0, NULL, 0, NULL);",
        "EVPRANDfree(rand);",
        "/* Feed this into a DRBG */",
        "rand = EVPRANDfetch(NULL, \"CTR-DRBG\", NULL);",
        "rctx = EVPRANDCTXnew(rand, seed);",
        "EVPRANDfree(rand);",
        "/* Configure the DRBG */",
        "*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);",
        "EVPRANDCTXfree(seed);"
    ],
    "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"
        }
    ]
}