{
    "content": [
        {
            "type": "text",
            "text": "# EVP_KDF-X963(7ssl) (man)\n\n**Summary:** EVPKDF-X963 - The X9.63-2001 EVPKDF implementation\n\n## Examples\n\n- `This example derives 10 bytes, with the secret key \"secret\" and sharedinfo value \"label\":`\n- `EVPKDF *kdf;`\n- `EVPKDFCTX *kctx;`\n- `unsigned char out[10];`\n- `OSSLPARAM params[4], *p = params;`\n- `kdf = EVPKDFfetch(NULL, \"X963KDF\", NULL);`\n- `kctx = EVPKDFCTXnew(kdf);`\n- `EVPKDFfree(kdf);`\n- `*p++ = OSSLPARAMconstructutf8string(OSSLKDFPARAMDIGEST,`\n- `SNsha256, strlen(SNsha256));`\n- `*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMSECRET,`\n- `\"secret\", (sizet)6);`\n- `*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMINFO,`\n- `\"label\", (sizet)5);`\n- `*p = OSSLPARAMconstructend();`\n- `if (EVPKDFderive(kctx, out, sizeof(out), params) <= 0) {`\n- `error(\"EVPKDFderive\");`\n- `EVPKDFCTXfree(kctx);`\n\n## See Also\n\n- EVPKDF(3)\n- EVPKDFCTXnew(3)\n- EVPKDFCTXfree(3)\n- EVPKDFCTXsetparams(3)\n- EVPKDFCTXgetkdfsize(3)\n- EVPKDFderive(3)\n- EVPKDF(3)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (4 lines) — 2 subsections\n  - Identity (3 lines)\n  - Supported parameters (12 lines)\n- **NOTES** (11 lines)\n- **EXAMPLES** (24 lines)\n- **CONFORMING TO** (2 lines)\n- **SEE ALSO** (3 lines)\n- **HISTORY** (2 lines)\n- **COPYRIGHT** (9 lines)\n\n## Full Content\n\n### NAME\n\nEVPKDF-X963 - The X9.63-2001 EVPKDF implementation\n\n### DESCRIPTION\n\nThe EVPKDF-X963 algorithm implements the key derivation function (X963KDF).  X963KDF is used\nby Cryptographic Message Syntax (CMS) for EC KeyAgreement, to derive a key using input such\nas a shared secret key and shared info.\n\n#### Identity\n\n\"X963KDF\" is the name for this implementation; it can be used with the EVPKDFfetch()\nfunction.\n\n#### Supported parameters\n\nThe supported parameters are:\n\n\"properties\" (OSSLKDFPARAMPROPERTIES) <UTF8 string>\n\"digest\" (OSSLKDFPARAMDIGEST) <UTF8 string>\nThese parameters work as described in \"PARAMETERS\" in EVPKDF(3).\n\n\"key\" (OSSLKDFPARAMKEY) <octet string>\nThe shared secret used for key derivation.  This parameter sets the secret.\n\n\"info\" (OSSLKDFPARAMINFO) <octet string>\nThis parameter specifies an optional value for shared info.\n\n### NOTES\n\nX963KDF is very similar to the SSKDF that uses a digest as the auxiliary function, X963KDF\nappends the counter to the secret, whereas SSKDF prepends the counter.\n\nA context for X963KDF can be obtained by calling:\n\nEVPKDF *kdf = EVPKDFfetch(NULL, \"X963KDF\", NULL);\nEVPKDFCTX *kctx = EVPKDFCTXnew(kdf);\n\nThe output length of an X963KDF is specified via the keylen parameter to the\nEVPKDFderive(3) function.\n\n### EXAMPLES\n\nThis example derives 10 bytes, with the secret key \"secret\" and sharedinfo value \"label\":\n\nEVPKDF *kdf;\nEVPKDFCTX *kctx;\nunsigned char out[10];\nOSSLPARAM params[4], *p = params;\n\nkdf = EVPKDFfetch(NULL, \"X963KDF\", NULL);\nkctx = EVPKDFCTXnew(kdf);\nEVPKDFfree(kdf);\n\n*p++ = OSSLPARAMconstructutf8string(OSSLKDFPARAMDIGEST,\nSNsha256, strlen(SNsha256));\n*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMSECRET,\n\"secret\", (sizet)6);\n*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMINFO,\n\"label\", (sizet)5);\n*p = OSSLPARAMconstructend();\nif (EVPKDFderive(kctx, out, sizeof(out), params) <= 0) {\nerror(\"EVPKDFderive\");\n}\n\nEVPKDFCTXfree(kctx);\n\n### CONFORMING TO\n\n\"SEC 1: Elliptic Curve Cryptography\"\n\n### SEE ALSO\n\nEVPKDF(3), EVPKDFCTXnew(3), EVPKDFCTXfree(3), EVPKDFCTXsetparams(3),\nEVPKDFCTXgetkdfsize(3), EVPKDFderive(3), \"PARAMETERS\" in EVPKDF(3)\n\n### HISTORY\n\nThis functionality was added to 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                           EVPKDF-X963(7SSL)\n\n"
        }
    ],
    "structuredContent": {
        "command": "EVP_KDF-X963",
        "section": "7ssl",
        "mode": "man",
        "summary": "EVPKDF-X963 - The X9.63-2001 EVPKDF implementation",
        "synopsis": null,
        "flags": [],
        "examples": [
            "This example derives 10 bytes, with the secret key \"secret\" and sharedinfo value \"label\":",
            "EVPKDF *kdf;",
            "EVPKDFCTX *kctx;",
            "unsigned char out[10];",
            "OSSLPARAM params[4], *p = params;",
            "kdf = EVPKDFfetch(NULL, \"X963KDF\", NULL);",
            "kctx = EVPKDFCTXnew(kdf);",
            "EVPKDFfree(kdf);",
            "*p++ = OSSLPARAMconstructutf8string(OSSLKDFPARAMDIGEST,",
            "SNsha256, strlen(SNsha256));",
            "*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMSECRET,",
            "\"secret\", (sizet)6);",
            "*p++ = OSSLPARAMconstructoctetstring(OSSLKDFPARAMINFO,",
            "\"label\", (sizet)5);",
            "*p = OSSLPARAMconstructend();",
            "if (EVPKDFderive(kctx, out, sizeof(out), params) <= 0) {",
            "error(\"EVPKDFderive\");",
            "EVPKDFCTXfree(kctx);"
        ],
        "see_also": [
            {
                "name": "EVPKDF",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDF/3/json"
            },
            {
                "name": "EVPKDFCTXnew",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDFCTXnew/3/json"
            },
            {
                "name": "EVPKDFCTXfree",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDFCTXfree/3/json"
            },
            {
                "name": "EVPKDFCTXsetparams",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDFCTXsetparams/3/json"
            },
            {
                "name": "EVPKDFCTXgetkdfsize",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDFCTXgetkdfsize/3/json"
            },
            {
                "name": "EVPKDFderive",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDFderive/3/json"
            },
            {
                "name": "EVPKDF",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKDF/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "Identity",
                        "lines": 3
                    },
                    {
                        "name": "Supported parameters",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}