{
    "content": [
        {
            "type": "text",
            "text": "# PROVIDER-DIGEST (man)\n\n**Summary:** provider-digest - The digest library <-> provider functions\n\n**Synopsis:** #include <openssl/coredispatch.h>\n#include <openssl/corenames.h>\n/*\n* Digests support the following function signatures in OSSLDISPATCH arrays.\n* (The function signatures are not actual functions).\n*/\n/* Context management */\nvoid *OSSLFUNCdigestnewctx(void *provctx);\nvoid OSSLFUNCdigestfreectx(void *dctx);\nvoid *OSSLFUNCdigestdupctx(void *dctx);\n/* Digest generation */\nint OSSLFUNCdigestinit(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestupdate(void *dctx, const unsigned char *in, sizet inl);\nint OSSLFUNCdigestfinal(void *dctx, unsigned char *out, sizet *outl,\nsizet outsz);\nint OSSLFUNCdigestdigest(void *provctx, const unsigned char *in, sizet inl,\nunsigned char *out, sizet *outl, sizet outsz);\n/* Digest parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettableparams(void *provctx);\n/* Digest operation parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettablectxparams(void *dctx,\nvoid *provctx);\nconst OSSLPARAM *OSSLFUNCdigestsettablectxparams(void *dctx,\nvoid *provctx);\n/* Digest parameters */\nint OSSLFUNCdigestgetparams(OSSLPARAM params[]);\n/* Digest operation parameters */\nint OSSLFUNCdigestsetctxparams(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestgetctxparams(void *dctx, OSSLPARAM params[]);\n\n## See Also\n\n- provider(7)\n- OSSLPROVIDER-FIPS(7)\n- OSSLPROVIDER-default(7)\n- OSSLPROVIDER-legacy(7)\n- EVPMD-common(7)\n- EVPMD-BLAKE2(7)\n- EVPMD-MD2(7)\n- EVPMD-MD4(7)\n- EVPMD-MD5(7)\n- EVPMD-MD5-SHA1(7)\n- EVPMD-MDC2(7)\n- EVPMD-RIPEMD160(7)\n- EVPMD-SHA1(7)\n- EVPMD-SHA2(7)\n- EVPMD-SHA3(7)\n- EVPMD-SHAKE(7)\n- EVPMD-SM3(7)\n- EVPMD-WHIRLPOOL(7)\n- lifecycle-digest(7)\n- EVPDigestInit(3)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (37 lines)\n- **DESCRIPTION** (46 lines) — 4 subsections\n  - Context Management Functions (11 lines)\n  - Digest Generation Functions (21 lines)\n  - Digest Parameters (60 lines)\n  - Digest Context Parameters (8 lines)\n- **RETURN VALUES** (12 lines)\n- **BUGS** (4 lines)\n- **SEE ALSO** (6 lines)\n- **HISTORY** (2 lines)\n- **COPYRIGHT** (9 lines)\n\n## Full Content\n\n### NAME\n\nprovider-digest - The digest library <-> provider functions\n\n### SYNOPSIS\n\n#include <openssl/coredispatch.h>\n#include <openssl/corenames.h>\n\n/*\n* Digests support the following function signatures in OSSLDISPATCH arrays.\n* (The function signatures are not actual functions).\n*/\n\n/* Context management */\nvoid *OSSLFUNCdigestnewctx(void *provctx);\nvoid OSSLFUNCdigestfreectx(void *dctx);\nvoid *OSSLFUNCdigestdupctx(void *dctx);\n\n/* Digest generation */\nint OSSLFUNCdigestinit(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestupdate(void *dctx, const unsigned char *in, sizet inl);\nint OSSLFUNCdigestfinal(void *dctx, unsigned char *out, sizet *outl,\nsizet outsz);\nint OSSLFUNCdigestdigest(void *provctx, const unsigned char *in, sizet inl,\nunsigned char *out, sizet *outl, sizet outsz);\n\n/* Digest parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettableparams(void *provctx);\n\n/* Digest operation parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettablectxparams(void *dctx,\nvoid *provctx);\nconst OSSLPARAM *OSSLFUNCdigestsettablectxparams(void *dctx,\nvoid *provctx);\n\n/* Digest parameters */\nint OSSLFUNCdigestgetparams(OSSLPARAM params[]);\n\n/* Digest operation parameters */\nint OSSLFUNCdigestsetctxparams(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestgetctxparams(void *dctx, OSSLPARAM params[]);\n\n### DESCRIPTION\n\nThis documentation is primarily aimed at provider authors. See provider(7) for further\ninformation.\n\nThe DIGEST operation enables providers to implement digest algorithms and make them available\nto applications via the API functions EVPDigestInitex(3), EVPDigestUpdate(3) and\nEVPDigestFinal(3) (and other related functions).\n\nAll \"functions\" mentioned here are passed as function pointers between libcrypto and the\nprovider in OSSLDISPATCH arrays via OSSLALGORITHM arrays that are returned by the\nprovider's providerqueryoperation() function (see \"Provider Functions\" in\nprovider-base(7)).\n\nAll these \"functions\" have a corresponding function type definition named\nOSSLFUNC{name}fn, and a helper function to retrieve the function pointer from an\nOSSLDISPATCH element named OSSLFUNC{name}.  For example, the \"function\"\nOSSLFUNCdigestnewctx() has these:\n\ntypedef void *(OSSLOSSLFUNCdigestnewctxfn)(void *provctx);\nstatic osslinline OSSLOSSLFUNCdigestnewctxfn\nOSSLFUNCdigestnewctx(const OSSLDISPATCH *opf);\n\nOSSLDISPATCH arrays are indexed by numbers that are provided as macros in\nopenssl-coredispatch.h(7), as follows:\n\nOSSLFUNCdigestnewctx               OSSLFUNCDIGESTNEWCTX\nOSSLFUNCdigestfreectx              OSSLFUNCDIGESTFREECTX\nOSSLFUNCdigestdupctx               OSSLFUNCDIGESTDUPCTX\n\nOSSLFUNCdigestinit                 OSSLFUNCDIGESTINIT\nOSSLFUNCdigestupdate               OSSLFUNCDIGESTUPDATE\nOSSLFUNCdigestfinal                OSSLFUNCDIGESTFINAL\nOSSLFUNCdigestdigest               OSSLFUNCDIGESTDIGEST\n\nOSSLFUNCdigestgetparams           OSSLFUNCDIGESTGETPARAMS\nOSSLFUNCdigestgetctxparams       OSSLFUNCDIGESTGETCTXPARAMS\nOSSLFUNCdigestsetctxparams       OSSLFUNCDIGESTSETCTXPARAMS\n\nOSSLFUNCdigestgettableparams      OSSLFUNCDIGESTGETTABLEPARAMS\nOSSLFUNCdigestgettablectxparams  OSSLFUNCDIGESTGETTABLECTXPARAMS\nOSSLFUNCdigestsettablectxparams  OSSLFUNCDIGESTSETTABLECTXPARAMS\n\nA digest algorithm implementation may not implement all of these functions.  In order to be\nusable all or none of OSSLFUNCdigestnewctx, OSSLFUNCdigestfreectx,\nOSSLFUNCdigestinit, OSSLFUNCdigestupdate and OSSLFUNCdigestfinal should be\nimplemented.  All other functions are optional.\n\n#### Context Management Functions\n\nOSSLFUNCdigestnewctx() should create and return a pointer to a provider side structure for\nholding context information during a digest operation.  A pointer to this context will be\npassed back in a number of the other digest operation function calls.  The parameter provctx\nis the provider context generated during provider initialisation (see provider(7)).\n\nOSSLFUNCdigestfreectx() is passed a pointer to the provider side digest context in the\ndctx parameter.  This function should free any resources associated with that context.\n\nOSSLFUNCdigestdupctx() should duplicate the provider side digest context in the dctx\nparameter and return the duplicate copy.\n\n#### Digest Generation Functions\n\nOSSLFUNCdigestinit() initialises a digest operation given a newly created provider side\ndigest context in the dctx parameter.  The params, if not NULL, should be set on the context\nin a manner similar to using OSSLFUNCdigestsetctxparams().\n\nOSSLFUNCdigestupdate() is called to supply data to be digested as part of a previously\ninitialised digest operation.  The dctx parameter contains a pointer to a previously\ninitialised provider side context.  OSSLFUNCdigestupdate() should digest inl bytes of data\nat the location pointed to by in.  OSSLFUNCdigestupdate() may be called multiple times for\na single digest operation.\n\nOSSLFUNCdigestfinal() generates a digest started through previous OSSLFUNCdigestinit()\nand OSSLFUNCdigestupdate() calls.  The dctx parameter contains a pointer to the provider\nside context.  The digest should be written to *out and the length of the digest to *outl.\nThe digest should not exceed outsz bytes.\n\nOSSLFUNCdigestdigest() is a \"oneshot\" digest function.  No provider side digest context is\nused.  Instead the provider context that was created during provider initialisation is passed\nin the provctx parameter (see provider(7)).  inl bytes at in should be digested and the\nresult should be stored at out. The length of the digest should be stored in *outl which\nshould not exceed outsz bytes.\n\n#### Digest Parameters\n\nSee OSSLPARAM(3) for further details on the parameters structure used by these functions.\n\nOSSLFUNCdigestgetparams() gets details of the algorithm implementation and stores them in\nparams.\n\nOSSLFUNCdigestsetctxparams() sets digest operation parameters for the provider side\ndigest context dctx to params.  Any parameter settings are additional to any that were\npreviously set.  Passing NULL for params should return true.\n\nOSSLFUNCdigestgetctxparams() gets digest operation details details from the given\nprovider side digest context dctx and stores them in params.  Passing NULL for params should\nreturn true.\n\nOSSLFUNCdigestgettableparams() returns a constant OSSLPARAM array containing descriptors\nof the parameters that OSSLFUNCdigestgetparams() can handle.\n\nOSSLFUNCdigestgettablectxparams() and OSSLFUNCdigestsettablectxparams() both return\nconstant OSSLPARAM arrays as descriptors of the parameters that\nOSSLFUNCdigestgetctxparams() and OSSLFUNCdigestsetctxparams() can handle,\nrespectively.  The array is based on the current state of the provider side context if dctx\nis not NULL and on the provider side algorithm provctx otherwise.\n\nParameters currently recognised by built-in digests with this function are as follows. Not\nall parameters are relevant to, or are understood by all digests:\n\n\"blocksize\" (OSSLDIGESTPARAMBLOCKSIZE) <unsigned integer>\nThe digest block size.  The length of the \"blocksize\" parameter should not exceed that of\na sizet.\n\n\"size\" (OSSLDIGESTPARAMSIZE) <unsigned integer>\nThe digest output size.  The length of the \"size\" parameter should not exceed that of a\nsizet.\n\n\"flags\" (OSSLDIGESTPARAMFLAGS) <unsigned integer>\nDiverse flags that describe exceptional behaviour for the digest:\n\nEVPMDFLAGONESHOT\nThis digest method can only handle one block of input.\n\nEVPMDFLAGXOF\nThis digest method is an extensible-output function (XOF) and supports setting the\nOSSLDIGESTPARAMXOFLEN parameter.\n\nEVPMDFLAGDIGALGIDNULL\nWhen setting up a DigestAlgorithmIdentifier, this flag will have the parameter set to\nNULL by default.  Use this for PKCS#1.  Note: if combined with\nEVPMDFLAGDIGALGIDABSENT, the latter will override.\n\nEVPMDFLAGDIGALGIDABSENT\nWhen setting up a DigestAlgorithmIdentifier, this flag will have the parameter be\nleft absent by default.  Note: if combined with EVPMDFLAGDIGALGIDNULL, the latter\nwill be overridden.\n\nEVPMDFLAGDIGALGIDCUSTOM\nCustom DigestAlgorithmIdentifier handling via ctrl, with EVPMDFLAGDIGALGIDABSENT\nas default.  Note: if combined with EVPMDFLAGDIGALGIDNULL, the latter will be\noverridden.  Currently unused.\n\nThe length of the \"flags\" parameter should equal that of an unsigned long int.\n\n#### Digest Context Parameters\n\nOSSLFUNCdigestsetctxparams() sets digest parameters associated with the given provider\nside digest context dctx to params.  Any parameter settings are additional to any that were\npreviously set.  See OSSLPARAM(3) for further details on the parameters structure.\n\nOSSLFUNCdigestgetctxparams() gets details of currently set parameters values associated\nwith the give provider side digest context dctx and stores them in params.  See OSSLPARAM(3)\nfor further details on the parameters structure.\n\n### RETURN VALUES\n\nOSSLFUNCdigestnewctx() and OSSLFUNCdigestdupctx() should return the newly created\nprovider side digest context, or NULL on failure.\n\nOSSLFUNCdigestinit(), OSSLFUNCdigestupdate(), OSSLFUNCdigestfinal(),\nOSSLFUNCdigestdigest(), OSSLFUNCdigestsetparams() and OSSLFUNCdigestgetparams()\nshould return 1 for success or 0 on error.\n\nOSSLFUNCdigestsize() should return the digest size.\n\nOSSLFUNCdigestblocksize() should return the block size of the underlying digest\nalgorithm.\n\n### BUGS\n\nThe EVPQdigest(), EVPDigest() and EVPDigestFinalex() API calls do not expect the digest\nsize to be larger than EVPMAXMDSIZE. Any algorithm which produces larger digests is\nunusable with those API calls.\n\n### SEE ALSO\n\nprovider(7), OSSLPROVIDER-FIPS(7), OSSLPROVIDER-default(7), OSSLPROVIDER-legacy(7),\nEVPMD-common(7), EVPMD-BLAKE2(7), EVPMD-MD2(7), EVPMD-MD4(7), EVPMD-MD5(7),\nEVPMD-MD5-SHA1(7), EVPMD-MDC2(7), EVPMD-RIPEMD160(7), EVPMD-SHA1(7), EVPMD-SHA2(7),\nEVPMD-SHA3(7), EVPMD-SHAKE(7), EVPMD-SM3(7), EVPMD-WHIRLPOOL(7), lifecycle-digest(7),\nEVPDigestInit(3)\n\n### HISTORY\n\nThe provider DIGEST interface was introduced in OpenSSL 3.0.\n\n### COPYRIGHT\n\nCopyright 2019-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\n\n\n3.0.2                                        2026-04-07                        PROVIDER-DIGEST(7SSL)\n\n"
        }
    ],
    "structuredContent": {
        "command": "PROVIDER-DIGEST",
        "section": "",
        "mode": "man",
        "summary": "provider-digest - The digest library <-> provider functions",
        "synopsis": "#include <openssl/coredispatch.h>\n#include <openssl/corenames.h>\n/*\n* Digests support the following function signatures in OSSLDISPATCH arrays.\n* (The function signatures are not actual functions).\n*/\n/* Context management */\nvoid *OSSLFUNCdigestnewctx(void *provctx);\nvoid OSSLFUNCdigestfreectx(void *dctx);\nvoid *OSSLFUNCdigestdupctx(void *dctx);\n/* Digest generation */\nint OSSLFUNCdigestinit(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestupdate(void *dctx, const unsigned char *in, sizet inl);\nint OSSLFUNCdigestfinal(void *dctx, unsigned char *out, sizet *outl,\nsizet outsz);\nint OSSLFUNCdigestdigest(void *provctx, const unsigned char *in, sizet inl,\nunsigned char *out, sizet *outl, sizet outsz);\n/* Digest parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettableparams(void *provctx);\n/* Digest operation parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettablectxparams(void *dctx,\nvoid *provctx);\nconst OSSLPARAM *OSSLFUNCdigestsettablectxparams(void *dctx,\nvoid *provctx);\n/* Digest parameters */\nint OSSLFUNCdigestgetparams(OSSLPARAM params[]);\n/* Digest operation parameters */\nint OSSLFUNCdigestsetctxparams(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestgetctxparams(void *dctx, OSSLPARAM params[]);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "provider",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/provider/7/json"
            },
            {
                "name": "OSSLPROVIDER-FIPS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/OSSLPROVIDER-FIPS/7/json"
            },
            {
                "name": "OSSLPROVIDER-default",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/OSSLPROVIDER-default/7/json"
            },
            {
                "name": "OSSLPROVIDER-legacy",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/OSSLPROVIDER-legacy/7/json"
            },
            {
                "name": "EVPMD-common",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-common/7/json"
            },
            {
                "name": "EVPMD-BLAKE2",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-BLAKE2/7/json"
            },
            {
                "name": "EVPMD-MD2",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-MD2/7/json"
            },
            {
                "name": "EVPMD-MD4",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-MD4/7/json"
            },
            {
                "name": "EVPMD-MD5",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-MD5/7/json"
            },
            {
                "name": "EVPMD-MD5-SHA1",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-MD5-SHA1/7/json"
            },
            {
                "name": "EVPMD-MDC2",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-MDC2/7/json"
            },
            {
                "name": "EVPMD-RIPEMD160",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-RIPEMD160/7/json"
            },
            {
                "name": "EVPMD-SHA1",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-SHA1/7/json"
            },
            {
                "name": "EVPMD-SHA2",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-SHA2/7/json"
            },
            {
                "name": "EVPMD-SHA3",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-SHA3/7/json"
            },
            {
                "name": "EVPMD-SHAKE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-SHAKE/7/json"
            },
            {
                "name": "EVPMD-SM3",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-SM3/7/json"
            },
            {
                "name": "EVPMD-WHIRLPOOL",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPMD-WHIRLPOOL/7/json"
            },
            {
                "name": "lifecycle-digest",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/lifecycle-digest/7/json"
            },
            {
                "name": "EVPDigestInit",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPDigestInit/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 46,
                "subsections": [
                    {
                        "name": "Context Management Functions",
                        "lines": 11
                    },
                    {
                        "name": "Digest Generation Functions",
                        "lines": 21
                    },
                    {
                        "name": "Digest Parameters",
                        "lines": 60
                    },
                    {
                        "name": "Digest Context Parameters",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "RETURN VALUES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "provider-digest - The digest library <-> provider functions\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#include <openssl/coredispatch.h>\n#include <openssl/corenames.h>\n\n/*\n* Digests support the following function signatures in OSSLDISPATCH arrays.\n* (The function signatures are not actual functions).\n*/\n\n/* Context management */\nvoid *OSSLFUNCdigestnewctx(void *provctx);\nvoid OSSLFUNCdigestfreectx(void *dctx);\nvoid *OSSLFUNCdigestdupctx(void *dctx);\n\n/* Digest generation */\nint OSSLFUNCdigestinit(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestupdate(void *dctx, const unsigned char *in, sizet inl);\nint OSSLFUNCdigestfinal(void *dctx, unsigned char *out, sizet *outl,\nsizet outsz);\nint OSSLFUNCdigestdigest(void *provctx, const unsigned char *in, sizet inl,\nunsigned char *out, sizet *outl, sizet outsz);\n\n/* Digest parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettableparams(void *provctx);\n\n/* Digest operation parameter descriptors */\nconst OSSLPARAM *OSSLFUNCdigestgettablectxparams(void *dctx,\nvoid *provctx);\nconst OSSLPARAM *OSSLFUNCdigestsettablectxparams(void *dctx,\nvoid *provctx);\n\n/* Digest parameters */\nint OSSLFUNCdigestgetparams(OSSLPARAM params[]);\n\n/* Digest operation parameters */\nint OSSLFUNCdigestsetctxparams(void *dctx, const OSSLPARAM params[]);\nint OSSLFUNCdigestgetctxparams(void *dctx, OSSLPARAM params[]);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This documentation is primarily aimed at provider authors. See provider(7) for further\ninformation.\n\nThe DIGEST operation enables providers to implement digest algorithms and make them available\nto applications via the API functions EVPDigestInitex(3), EVPDigestUpdate(3) and\nEVPDigestFinal(3) (and other related functions).\n\nAll \"functions\" mentioned here are passed as function pointers between libcrypto and the\nprovider in OSSLDISPATCH arrays via OSSLALGORITHM arrays that are returned by the\nprovider's providerqueryoperation() function (see \"Provider Functions\" in\nprovider-base(7)).\n\nAll these \"functions\" have a corresponding function type definition named\nOSSLFUNC{name}fn, and a helper function to retrieve the function pointer from an\nOSSLDISPATCH element named OSSLFUNC{name}.  For example, the \"function\"\nOSSLFUNCdigestnewctx() has these:\n\ntypedef void *(OSSLOSSLFUNCdigestnewctxfn)(void *provctx);\nstatic osslinline OSSLOSSLFUNCdigestnewctxfn\nOSSLFUNCdigestnewctx(const OSSLDISPATCH *opf);\n\nOSSLDISPATCH arrays are indexed by numbers that are provided as macros in\nopenssl-coredispatch.h(7), as follows:\n\nOSSLFUNCdigestnewctx               OSSLFUNCDIGESTNEWCTX\nOSSLFUNCdigestfreectx              OSSLFUNCDIGESTFREECTX\nOSSLFUNCdigestdupctx               OSSLFUNCDIGESTDUPCTX\n\nOSSLFUNCdigestinit                 OSSLFUNCDIGESTINIT\nOSSLFUNCdigestupdate               OSSLFUNCDIGESTUPDATE\nOSSLFUNCdigestfinal                OSSLFUNCDIGESTFINAL\nOSSLFUNCdigestdigest               OSSLFUNCDIGESTDIGEST\n\nOSSLFUNCdigestgetparams           OSSLFUNCDIGESTGETPARAMS\nOSSLFUNCdigestgetctxparams       OSSLFUNCDIGESTGETCTXPARAMS\nOSSLFUNCdigestsetctxparams       OSSLFUNCDIGESTSETCTXPARAMS\n\nOSSLFUNCdigestgettableparams      OSSLFUNCDIGESTGETTABLEPARAMS\nOSSLFUNCdigestgettablectxparams  OSSLFUNCDIGESTGETTABLECTXPARAMS\nOSSLFUNCdigestsettablectxparams  OSSLFUNCDIGESTSETTABLECTXPARAMS\n\nA digest algorithm implementation may not implement all of these functions.  In order to be\nusable all or none of OSSLFUNCdigestnewctx, OSSLFUNCdigestfreectx,\nOSSLFUNCdigestinit, OSSLFUNCdigestupdate and OSSLFUNCdigestfinal should be\nimplemented.  All other functions are optional.\n",
                "subsections": [
                    {
                        "name": "Context Management Functions",
                        "content": "OSSLFUNCdigestnewctx() should create and return a pointer to a provider side structure for\nholding context information during a digest operation.  A pointer to this context will be\npassed back in a number of the other digest operation function calls.  The parameter provctx\nis the provider context generated during provider initialisation (see provider(7)).\n\nOSSLFUNCdigestfreectx() is passed a pointer to the provider side digest context in the\ndctx parameter.  This function should free any resources associated with that context.\n\nOSSLFUNCdigestdupctx() should duplicate the provider side digest context in the dctx\nparameter and return the duplicate copy.\n"
                    },
                    {
                        "name": "Digest Generation Functions",
                        "content": "OSSLFUNCdigestinit() initialises a digest operation given a newly created provider side\ndigest context in the dctx parameter.  The params, if not NULL, should be set on the context\nin a manner similar to using OSSLFUNCdigestsetctxparams().\n\nOSSLFUNCdigestupdate() is called to supply data to be digested as part of a previously\ninitialised digest operation.  The dctx parameter contains a pointer to a previously\ninitialised provider side context.  OSSLFUNCdigestupdate() should digest inl bytes of data\nat the location pointed to by in.  OSSLFUNCdigestupdate() may be called multiple times for\na single digest operation.\n\nOSSLFUNCdigestfinal() generates a digest started through previous OSSLFUNCdigestinit()\nand OSSLFUNCdigestupdate() calls.  The dctx parameter contains a pointer to the provider\nside context.  The digest should be written to *out and the length of the digest to *outl.\nThe digest should not exceed outsz bytes.\n\nOSSLFUNCdigestdigest() is a \"oneshot\" digest function.  No provider side digest context is\nused.  Instead the provider context that was created during provider initialisation is passed\nin the provctx parameter (see provider(7)).  inl bytes at in should be digested and the\nresult should be stored at out. The length of the digest should be stored in *outl which\nshould not exceed outsz bytes.\n"
                    },
                    {
                        "name": "Digest Parameters",
                        "content": "See OSSLPARAM(3) for further details on the parameters structure used by these functions.\n\nOSSLFUNCdigestgetparams() gets details of the algorithm implementation and stores them in\nparams.\n\nOSSLFUNCdigestsetctxparams() sets digest operation parameters for the provider side\ndigest context dctx to params.  Any parameter settings are additional to any that were\npreviously set.  Passing NULL for params should return true.\n\nOSSLFUNCdigestgetctxparams() gets digest operation details details from the given\nprovider side digest context dctx and stores them in params.  Passing NULL for params should\nreturn true.\n\nOSSLFUNCdigestgettableparams() returns a constant OSSLPARAM array containing descriptors\nof the parameters that OSSLFUNCdigestgetparams() can handle.\n\nOSSLFUNCdigestgettablectxparams() and OSSLFUNCdigestsettablectxparams() both return\nconstant OSSLPARAM arrays as descriptors of the parameters that\nOSSLFUNCdigestgetctxparams() and OSSLFUNCdigestsetctxparams() can handle,\nrespectively.  The array is based on the current state of the provider side context if dctx\nis not NULL and on the provider side algorithm provctx otherwise.\n\nParameters currently recognised by built-in digests with this function are as follows. Not\nall parameters are relevant to, or are understood by all digests:\n\n\"blocksize\" (OSSLDIGESTPARAMBLOCKSIZE) <unsigned integer>\nThe digest block size.  The length of the \"blocksize\" parameter should not exceed that of\na sizet.\n\n\"size\" (OSSLDIGESTPARAMSIZE) <unsigned integer>\nThe digest output size.  The length of the \"size\" parameter should not exceed that of a\nsizet.\n\n\"flags\" (OSSLDIGESTPARAMFLAGS) <unsigned integer>\nDiverse flags that describe exceptional behaviour for the digest:\n\nEVPMDFLAGONESHOT\nThis digest method can only handle one block of input.\n\nEVPMDFLAGXOF\nThis digest method is an extensible-output function (XOF) and supports setting the\nOSSLDIGESTPARAMXOFLEN parameter.\n\nEVPMDFLAGDIGALGIDNULL\nWhen setting up a DigestAlgorithmIdentifier, this flag will have the parameter set to\nNULL by default.  Use this for PKCS#1.  Note: if combined with\nEVPMDFLAGDIGALGIDABSENT, the latter will override.\n\nEVPMDFLAGDIGALGIDABSENT\nWhen setting up a DigestAlgorithmIdentifier, this flag will have the parameter be\nleft absent by default.  Note: if combined with EVPMDFLAGDIGALGIDNULL, the latter\nwill be overridden.\n\nEVPMDFLAGDIGALGIDCUSTOM\nCustom DigestAlgorithmIdentifier handling via ctrl, with EVPMDFLAGDIGALGIDABSENT\nas default.  Note: if combined with EVPMDFLAGDIGALGIDNULL, the latter will be\noverridden.  Currently unused.\n\nThe length of the \"flags\" parameter should equal that of an unsigned long int.\n"
                    },
                    {
                        "name": "Digest Context Parameters",
                        "content": "OSSLFUNCdigestsetctxparams() sets digest parameters associated with the given provider\nside digest context dctx to params.  Any parameter settings are additional to any that were\npreviously set.  See OSSLPARAM(3) for further details on the parameters structure.\n\nOSSLFUNCdigestgetctxparams() gets details of currently set parameters values associated\nwith the give provider side digest context dctx and stores them in params.  See OSSLPARAM(3)\nfor further details on the parameters structure.\n"
                    }
                ]
            },
            "RETURN VALUES": {
                "content": "OSSLFUNCdigestnewctx() and OSSLFUNCdigestdupctx() should return the newly created\nprovider side digest context, or NULL on failure.\n\nOSSLFUNCdigestinit(), OSSLFUNCdigestupdate(), OSSLFUNCdigestfinal(),\nOSSLFUNCdigestdigest(), OSSLFUNCdigestsetparams() and OSSLFUNCdigestgetparams()\nshould return 1 for success or 0 on error.\n\nOSSLFUNCdigestsize() should return the digest size.\n\nOSSLFUNCdigestblocksize() should return the block size of the underlying digest\nalgorithm.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "The EVPQdigest(), EVPDigest() and EVPDigestFinalex() API calls do not expect the digest\nsize to be larger than EVPMAXMDSIZE. Any algorithm which produces larger digests is\nunusable with those API calls.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "provider(7), OSSLPROVIDER-FIPS(7), OSSLPROVIDER-default(7), OSSLPROVIDER-legacy(7),\nEVPMD-common(7), EVPMD-BLAKE2(7), EVPMD-MD2(7), EVPMD-MD4(7), EVPMD-MD5(7),\nEVPMD-MD5-SHA1(7), EVPMD-MDC2(7), EVPMD-RIPEMD160(7), EVPMD-SHA1(7), EVPMD-SHA2(7),\nEVPMD-SHA3(7), EVPMD-SHAKE(7), EVPMD-SM3(7), EVPMD-WHIRLPOOL(7), lifecycle-digest(7),\nEVPDigestInit(3)\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "The provider DIGEST interface was introduced in OpenSSL 3.0.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2019-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\n\n\n3.0.2                                        2026-04-07                        PROVIDER-DIGEST(7SSL)",
                "subsections": []
            }
        }
    }
}