€•3üŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/crypto/userspace-if”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒtarget”“”)�”}”(hŒ.. _crypto_userspace_interface:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œcrypto-userspace-interface”uh1hµh´Khhh²hh³ŒA/var/lib/git/docbuild/linux/Documentation/crypto/userspace-if.rst”ubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒUser Space Interface”h]”hŒUser Space Interface”…”�”}”(hhËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhhÆh²hh³hÃh´KubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒ Introduction”h]”hŒ Introduction”…”�”}”(hhÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhhÙh²hh³hÃh´KubhŒ paragraph”“”)�”}”(hŒžAF_ALG provides unprivileged userspace programs access to arbitrary hash, symmetric cipher, AEAD, and RNG algorithms that are implemented in kernel-mode code.”h]”hŒžAF_ALG provides unprivileged userspace programs access to arbitrary hash, symmetric cipher, AEAD, and RNG algorithms that are implemented in kernel-mode code.”…”�”}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K hhÙh²hubhë)�”}”(hŒäAF_ALG is insecure and is deprecated. Originally added to the kernel in 2010, most kernel developers now consider it to be a mistake. Support for hardware accelerators, which was the original purpose of AF_ALG, has been removed.”h]”hŒäAF_ALG is insecure and is deprecated. Originally added to the kernel in 2010, most kernel developers now consider it to be a mistake. Support for hardware accelerators, which was the original purpose of AF_ALG, has been removed.”…”�”}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K hhÙh²hubhë)�”}”(hŒBAF_ALG continues to be supported only for backwards compatibility.”h]”hŒBAF_ALG continues to be supported only for backwards compatibility.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KhhÙh²hubhë)�”}”(hŒ—Starting in Linux v7.3, the set of algorithms supported by AF_ALG is limited by default. See :ref:`/proc/sys/crypto/af_alg_restrict `.”h]”(hŒ]Starting in Linux v7.3, the set of algorithms supported by AF_ALG is limited by default. See ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ9:ref:`/proc/sys/crypto/af_alg_restrict `”h]”hŒinline”“”)�”}”(hj h]”hŒ /proc/sys/crypto/af_alg_restrict”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j"hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œcrypto/userspace-if”Œ refdomain”j/Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œaf_alg_restrict”uh1hh³hÃh´KhjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KhhÙh²hubhë)�”}”(hŒßOn systems where no programs using AF_ALG remain, the support for it should be disabled entirely by setting ``/proc/sys/crypto/af_alg_restrict`` to 2 or by disabling ``CONFIG_CRYPTO_USER_API_*`` in the kernel configuration.”h]”(hŒlOn systems where no programs using AF_ALG remain, the support for it should be disabled entirely by setting ”…”�”}”(hjMh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ$``/proc/sys/crypto/af_alg_restrict``”h]”hŒ /proc/sys/crypto/af_alg_restrict”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjMubhŒ to 2 or by disabling ”…”�”}”(hjMh²hh³Nh´NubjV)�”}”(hŒ``CONFIG_CRYPTO_USER_API_*``”h]”hŒCONFIG_CRYPTO_USER_API_*”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjMubhŒ in the kernel configuration.”…”�”}”(hjMh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KhhÙh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´KubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒ Deprecation”h]”hŒ Deprecation”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj‰h²hh³hÃh´Kubhë)�”}”(hŒ‡AF_ALG was originally intended to provide userspace programs access to crypto accelerators that they wouldn't otherwise have access to.”h]”hŒ‰AF_ALG was originally intended to provide userspace programs access to crypto accelerators that they wouldn’t otherwise have access to.”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Khj‰h²hubhë)�”}”(hŒìHowever, that capability turned out to not be useful on very many systems. More significantly, the actual implementation exposes a vastly greater amount of functionality than that. It actually provides access to all software algorithms.”h]”hŒìHowever, that capability turned out to not be useful on very many systems. More significantly, the actual implementation exposes a vastly greater amount of functionality than that. It actually provides access to all software algorithms.”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K hj‰h²hubhë)�”}”(hX6This includes arbitrary compositions of different algorithms created via a complex template system, as well as algorithms that only make sense as internal implementation details of other algorithms. In the past, it also included full zero-copy support, which was difficult for the kernel to implement securely.”h]”hX6This includes arbitrary compositions of different algorithms created via a complex template system, as well as algorithms that only make sense as internal implementation details of other algorithms. In the past, it also included full zero-copy support, which was difficult for the kernel to implement securely.”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K$hj‰h²hubhë)�”}”(hŒÇUltimately, these algorithms are just math computations. They use the same instructions that userspace programs already have access to, just accessed in a much more convoluted and less efficient way.”h]”hŒÇUltimately, these algorithms are just math computations. They use the same instructions that userspace programs already have access to, just accessed in a much more convoluted and less efficient way.”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K)hj‰h²hubhë)�”}”(hŒŽIndeed, userspace code is nearly always what is being used anyway. These same algorithms are widely implemented in userspace crypto libraries.”h]”hŒŽIndeed, userspace code is nearly always what is being used anyway. These same algorithms are widely implemented in userspace crypto libraries.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K-hj‰h²hubhë)�”}”(hX¢Even when zero-copy and off-CPU accelerators were supported, AF_ALG was usually much slower than optimized software cryptography in userspace. This was especially true for the small message sizes usually seen in performance-critical workloads. While it was possible to demonstrate performance wins for hashing large files on embedded devices, it is hard to imagine a situation where this would be performance-critical.”h]”hX¢Even when zero-copy and off-CPU accelerators were supported, AF_ALG was usually much slower than optimized software cryptography in userspace. This was especially true for the small message sizes usually seen in performance-critical workloads. While it was possible to demonstrate performance wins for hashing large files on embedded devices, it is hard to imagine a situation where this would be performance-critical.”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K0hj‰h²hubhë)�”}”(hXËNowadays, AF_ALG no longer supports zero-copy or off-CPU accelerators. Therefore, it is *always* slower than an optimized userspace implementation, even for large messages. The only possible advantage left is that it avoids duplicating code between kernel and userspace. However, userspace implementations, especially hardware-accelerated ones, do not need to be large. Just because OpenSSL is huge does not mean that all userspace cryptography libraries are.”h]”(hŒXNowadays, AF_ALG no longer supports zero-copy or off-CPU accelerators. Therefore, it is ”…”�”}”(hjîh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ*always*”h]”hŒalways”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhjîubhXk slower than an optimized userspace implementation, even for large messages. The only possible advantage left is that it avoids duplicating code between kernel and userspace. However, userspace implementations, especially hardware-accelerated ones, do not need to be large. Just because OpenSSL is huge does not mean that all userspace cryptography libraries are.”…”�”}”(hjîh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K7hj‰h²hubhë)�”}”(hŒ¼Meanwhile, AF_ALG hasn't been withstanding modern vulnerability discovery tools such as syzbot and large language models. It receives a steady stream of CVEs. Some of the examples include:”h]”hŒ¾Meanwhile, AF_ALG hasn’t been withstanding modern vulnerability discovery tools such as syzbot and large language models. It receives a steady stream of CVEs. Some of the examples include:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K?hj‰h²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒCVE-2026-31677”h]”hë)�”}”(hj'h]”hŒCVE-2026-31677”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KChj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ"CVE-2026-31431 (https://copy.fail)”h]”hë)�”}”(hj>h]”(hŒCVE-2026-31431 (”…”�”}”(hj@h²hh³Nh´NubhŒ reference”“”)�”}”(hŒhttps://copy.fail”h]”hŒhttps://copy.fail”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jKuh1jGhj@ubhŒ)”…”�”}”(hj@h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KDhj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2025-38079”h]”hë)�”}”(hjjh]”hŒCVE-2025-38079”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KEhjhubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2025-37808”h]”hë)�”}”(hj�h]”hŒCVE-2025-37808”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KFhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2024-26824”h]”hë)�”}”(hj˜h]”hŒCVE-2024-26824”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KGhj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2022-48781”h]”hë)�”}”(hj¯h]”hŒCVE-2022-48781”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KHhj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ CVE-2019-8912”h]”hë)�”}”(hjÆh]”hŒ CVE-2019-8912”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KIhjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2018-14619”h]”hë)�”}”(hjÝh]”hŒCVE-2018-14619”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KJhjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2017-18075”h]”hë)�”}”(hjôh]”hŒCVE-2017-18075”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KKhjòubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2017-17806”h]”hë)�”}”(hj h]”hŒCVE-2017-17806”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KLhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2017-17805”h]”hë)�”}”(hj"h]”hŒCVE-2017-17805”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KMhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2016-10147”h]”hë)�”}”(hj9h]”hŒCVE-2016-10147”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KNhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ CVE-2015-8970”h]”hë)�”}”(hjPh]”hŒ CVE-2015-8970”…”�”}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KOhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ CVE-2015-3331”h]”hë)�”}”(hjgh]”hŒ CVE-2015-3331”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KPhjeubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ CVE-2014-9644”h]”hë)�”}”(hj~h]”hŒ CVE-2014-9644”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KQhj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒ CVE-2013-7421”h]”hë)�”}”(hj•h]”hŒ CVE-2013-7421”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KRhj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCVE-2011-4081 ”h]”hë)�”}”(hŒ CVE-2011-4081”h]”hŒ CVE-2011-4081”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KShjªubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jh³hÃh´KChj‰h²hubhë)�”}”(hŒÓHardware accelerator drivers are frequently buggy. To reduce attack surface, AF_ALG now only provides access to algorithms implemented in software. This means that AF_ALG no longer fulfills its original purpose.”h]”hŒÓHardware accelerator drivers are frequently buggy. To reduce attack surface, AF_ALG now only provides access to algorithms implemented in software. This means that AF_ALG no longer fulfills its original purpose.”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KUhj‰h²hubhë)�”}”(hX)It is recommended that, whenever possible, userspace programs be migrated to userspace crypto code (which again, is what is normally used anyway) and ``CONFIG_CRYPTO_USER_API_*`` be disabled. On systems that use SELinux, SELinux can also be used to restrict the use of AF_ALG to trusted programs.”h]”(hŒ–It is recommended that, whenever possible, userspace programs be migrated to userspace crypto code (which again, is what is normally used anyway) and ”…”�”}”(hjØh²hh³Nh´NubjV)�”}”(hŒ``CONFIG_CRYPTO_USER_API_*``”h]”hŒCONFIG_CRYPTO_USER_API_*”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjØubhŒw be disabled. On systems that use SELinux, SELinux can also be used to restrict the use of AF_ALG to trusted programs.”…”�”}”(hjØh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KYhj‰h²hubhë)�”}”(hŒnThe remainder of this documentation provides the historical documentation for the deprecated AF_ALG interface.”h]”hŒnThe remainder of this documentation provides the historical documentation for the deprecated AF_ALG interface.”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K^hj‰h²hubeh}”(h]”Œ deprecation”ah ]”h"]”Œ deprecation”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´KubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒUser Space API General Remarks”h]”hŒUser Space API General Remarks”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhjh²hh³hÃh´Kbubhë)�”}”(hŒeThe kernel crypto API is accessible from user space. Currently, the following ciphers are accessible:”h]”hŒeThe kernel crypto API is accessible from user space. Currently, the following ciphers are accessible:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kdhjh²hubj)�”}”(hhh]”(j$)�”}”(hŒ;Message digest including keyed message digest (HMAC, CMAC) ”h]”hë)�”}”(hŒ:Message digest including keyed message digest (HMAC, CMAC)”h]”hŒ:Message digest including keyed message digest (HMAC, CMAC)”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kghj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj-h²hh³hÃh´Nubj$)�”}”(hŒSymmetric ciphers ”h]”hë)�”}”(hŒSymmetric ciphers”h]”hŒSymmetric ciphers”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KihjHubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj-h²hh³hÃh´Nubj$)�”}”(hŒ AEAD ciphers ”h]”hë)�”}”(hŒ AEAD ciphers”h]”hŒ AEAD ciphers”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kkhj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj-h²hh³hÃh´Nubj$)�”}”(hŒRandom Number Generators ”h]”hë)�”}”(hŒRandom Number Generators”h]”hŒRandom Number Generators”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kmhjxubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj-h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´Kghjh²hubhë)�”}”(hŒÑThe interface is provided via socket type using the type AF_ALG. In addition, the setsockopt option type is SOL_ALG. In case the user space header files do not export these flags yet, use the following macros:”h]”hŒÑThe interface is provided via socket type using the type AF_ALG. In addition, the setsockopt option type is SOL_ALG. In case the user space header files do not export these flags yet, use the following macros:”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kohjh²hubhŒ literal_block”“”)�”}”(hŒR#ifndef AF_ALG #define AF_ALG 38 #endif #ifndef SOL_ALG #define SOL_ALG 279 #endif”h]”hŒR#ifndef AF_ALG #define AF_ALG 38 #endif #ifndef SOL_ALG #define SOL_ALG 279 #endif”…”�”}”hj¦sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j¤h³hÃh´Kuhjh²hubhë)�”}”(hŒÇA cipher is accessed with the same name as done for the in-kernel API calls. This includes the generic vs. unique naming schema for ciphers as well as the enforcement of priorities for generic names.”h]”hŒÇA cipher is accessed with the same name as done for the in-kernel API calls. This includes the generic vs. unique naming schema for ciphers as well as the enforcement of priorities for generic names.”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K}hjh²hubhë)�”}”(hX To interact with the kernel crypto API, a socket must be created by the user space application. User space invokes the cipher operation with the send()/write() system call family. The result of the cipher operation is obtained with the read()/recv() system call family.”h]”hX To interact with the kernel crypto API, a socket must be created by the user space application. User space invokes the cipher operation with the send()/write() system call family. The result of the cipher operation is obtained with the read()/recv() system call family.”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K�hjh²hubhë)�”}”(hŒ¨The following API calls assume that the socket descriptor is already opened by the user space application and discusses only the kernel crypto API specific invocations.”h]”hŒ¨The following API calls assume that the socket descriptor is already opened by the user space application and discusses only the kernel crypto API specific invocations.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K†hjh²hubhë)�”}”(hŒ_To initialize the socket interface, the following sequence has to be performed by the consumer:”h]”hŒ_To initialize the socket interface, the following sequence has to be performed by the consumer:”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KŠhjh²hubhŒenumerated_list”“”)�”}”(hhh]”(j$)�”}”(hŒvCreate a socket of type AF_ALG with the struct sockaddr_alg parameter specified below for the different cipher types. ”h]”hë)�”}”(hŒuCreate a socket of type AF_ALG with the struct sockaddr_alg parameter specified below for the different cipher types.”h]”hŒuCreate a socket of type AF_ALG with the struct sockaddr_alg parameter specified below for the different cipher types.”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K�hjóubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjðh²hh³hÃh´Nubj$)�”}”(hŒ'Invoke bind with the socket descriptor ”h]”hë)�”}”(hŒ&Invoke bind with the socket descriptor”h]”hŒ&Invoke bind with the socket descriptor”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K�hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjðh²hh³hÃh´Nubj$)�”}”(hXFInvoke accept with the socket descriptor. The accept system call returns a new file descriptor that is to be used to interact with the particular cipher instance. When invoking send/write or recv/read system calls to send data to the kernel or obtain data from the kernel, the file descriptor returned by accept must be used. ”h]”hë)�”}”(hXEInvoke accept with the socket descriptor. The accept system call returns a new file descriptor that is to be used to interact with the particular cipher instance. When invoking send/write or recv/read system calls to send data to the kernel or obtain data from the kernel, the file descriptor returned by accept must be used.”h]”hXEInvoke accept with the socket descriptor. The accept system call returns a new file descriptor that is to be used to interact with the particular cipher instance. When invoking send/write or recv/read system calls to send data to the kernel or obtain data from the kernel, the file descriptor returned by accept must be used.”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K’hj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjðh²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jîhjh²hh³hÃh´K�ubeh}”(h]”Œuser-space-api-general-remarks”ah ]”h"]”Œuser space api general remarks”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´KbubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒIn-place Cipher operation”h]”hŒIn-place Cipher operation”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhjNh²hh³hÃh´K™ubhë)�”}”(hX›Just like the in-kernel operation of the kernel crypto API, the user space interface allows the cipher operation in-place. That means that the input buffer used for the send/write system call and the output buffer used by the read/recv system call may be one and the same. This is of particular interest for symmetric cipher operations where a copying of the output data to its final destination can be avoided.”h]”hX›Just like the in-kernel operation of the kernel crypto API, the user space interface allows the cipher operation in-place. That means that the input buffer used for the send/write system call and the output buffer used by the read/recv system call may be one and the same. This is of particular interest for symmetric cipher operations where a copying of the output data to its final destination can be avoided.”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K›hjNh²hubhë)�”}”(hŒáIf a consumer on the other hand wants to maintain the plaintext and the ciphertext in different memory locations, all a consumer needs to do is to provide different memory pointers for the encryption and decryption operation.”h]”hŒáIf a consumer on the other hand wants to maintain the plaintext and the ciphertext in different memory locations, all a consumer needs to do is to provide different memory pointers for the encryption and decryption operation.”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K¢hjNh²hubeh}”(h]”Œin-place-cipher-operation”ah ]”h"]”Œin-place cipher operation”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´K™ubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒMessage Digest API”h]”hŒMessage Digest API”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhjƒh²hh³hÃh´K¨ubhë)�”}”(hŒãThe message digest type to be used for the cipher operation is selected when invoking the bind syscall. bind requires the caller to provide a filled struct sockaddr data structure. This data structure must be filled as follows:”h]”hŒãThe message digest type to be used for the cipher operation is selected when invoking the bind syscall. bind requires the caller to provide a filled struct sockaddr data structure. This data structure must be filled as follows:”…”�”}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kªhjƒh²hubj¥)�”}”(hŒ·struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "hash", /* this selects the hash logic in the kernel */ .salg_name = "sha1" /* this is the cipher name */ };”h]”hŒ·struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "hash", /* this selects the hash logic in the kernel */ .salg_name = "sha1" /* this is the cipher name */ };”…”�”}”hj¢sbah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j¤h³hÃh´K±hjƒh²hubhë)�”}”(hX The salg_type value "hash" applies to message digests and keyed message digests. Though, a keyed message digest is referenced by the appropriate salg_name. Please see below for the setsockopt interface that explains how the key can be set for a keyed message digest.”h]”hXThe salg_type value “hashâ€� applies to message digests and keyed message digests. Though, a keyed message digest is referenced by the appropriate salg_name. Please see below for the setsockopt interface that explains how the key can be set for a keyed message digest.”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K¸hjƒh²hubhë)�”}”(hŒ²Using the send() system call, the application provides the data that should be processed with the message digest. The send system call allows the following flags to be specified:”h]”hŒ²Using the send() system call, the application provides the data that should be processed with the message digest. The send system call allows the following flags to be specified:”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K½hjƒh²hubj)�”}”(hhh]”j$)�”}”(hŒéMSG_MORE: If this flag is set, the send system call acts like a message digest update function where the final hash is not yet calculated. If the flag is not set, the send system call calculates the final message digest immediately. ”h]”hë)�”}”(hŒèMSG_MORE: If this flag is set, the send system call acts like a message digest update function where the final hash is not yet calculated. If the flag is not set, the send system call calculates the final message digest immediately.”h]”hŒèMSG_MORE: If this flag is set, the send system call acts like a message digest update function where the final hash is not yet calculated. If the flag is not set, the send system call calculates the final message digest immediately.”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KÁhjÏubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjÌh²hh³hÃh´Nubah}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´KÁhjƒh²hubhë)�”}”(hŒÀWith the recv() system call, the application can read the message digest from the kernel crypto API. If the buffer is too small for the message digest, the flag MSG_TRUNC is set by the kernel.”h]”hŒÀWith the recv() system call, the application can read the message digest from the kernel crypto API. If the buffer is too small for the message digest, the flag MSG_TRUNC is set by the kernel.”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KÆhjƒh²hubhë)�”}”(hŒúIn order to set a message digest key, the calling application must use the setsockopt() option of ALG_SET_KEY or ALG_SET_KEY_BY_KEY_SERIAL. If the key is not set the HMAC operation is performed without the initial HMAC state change caused by the key.”h]”hŒúIn order to set a message digest key, the calling application must use the setsockopt() option of ALG_SET_KEY or ALG_SET_KEY_BY_KEY_SERIAL. If the key is not set the HMAC operation is performed without the initial HMAC state change caused by the key.”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KÊhjƒh²hubeh}”(h]”Œmessage-digest-api”ah ]”h"]”Œmessage digest api”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´K¨ubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒSymmetric Cipher API”h]”hŒSymmetric Cipher API”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhjh²hh³hÃh´KÐubhë)�”}”(hŒ”The operation is very similar to the message digest discussion. During initialization, the struct sockaddr data structure must be filled as follows:”h]”hŒ”The operation is very similar to the message digest discussion. During initialization, the struct sockaddr data structure must be filled as follows:”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´KÒhjh²hubj¥)�”}”(hŒ·struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "skcipher", /* this selects the symmetric cipher */ .salg_name = "cbc(aes)" /* this is the cipher name */ };”h]”hŒ·struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "skcipher", /* this selects the symmetric cipher */ .salg_name = "cbc(aes)" /* this is the cipher name */ };”…”�”}”hj0sbah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j¤h³hÃh´KØhjh²hubhë)�”}”(hŒ°Before data can be sent to the kernel using the write/send system call family, the consumer must set the key. The key setting is described with the setsockopt invocation below.”h]”hŒ°Before data can be sent to the kernel using the write/send system call family, the consumer must set the key. The key setting is described with the setsockopt invocation below.”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kßhjh²hubhë)�”}”(hŒÙUsing the sendmsg() system call, the application provides the data that should be processed for encryption or decryption. In addition, the IV is specified with the data structure provided by the sendmsg() system call.”h]”hŒÙUsing the sendmsg() system call, the application provides the data that should be processed for encryption or decryption. In addition, the IV is specified with the data structure provided by the sendmsg() system call.”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kãhjh²hubhë)�”}”(hXUThe sendmsg system call parameter of struct msghdr is embedded into the struct cmsghdr data structure. See recv(2) and cmsg(3) for more information on how the cmsghdr data structure is used together with the send/recv system call family. That cmsghdr data structure holds the following information specified with a separate header instances:”h]”hXUThe sendmsg system call parameter of struct msghdr is embedded into the struct cmsghdr data structure. See recv(2) and cmsg(3) for more information on how the cmsghdr data structure is used together with the send/recv system call family. That cmsghdr data structure holds the following information specified with a separate header instances:”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kçhjh²hubj)�”}”(hhh]”(j$)�”}”(hŒ”specification of the cipher operation type with one of these flags: - ALG_OP_ENCRYPT - encryption of data - ALG_OP_DECRYPT - decryption of data ”h]”(hë)�”}”(hŒCspecification of the cipher operation type with one of these flags:”h]”hŒCspecification of the cipher operation type with one of these flags:”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kíhjkubj)�”}”(hhh]”(j$)�”}”(hŒ$ALG_OP_ENCRYPT - encryption of data ”h]”hë)�”}”(hŒ#ALG_OP_ENCRYPT - encryption of data”h]”hŒ#ALG_OP_ENCRYPT - encryption of data”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kïhj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj}ubj$)�”}”(hŒ$ALG_OP_DECRYPT - decryption of data ”h]”hë)�”}”(hŒ#ALG_OP_DECRYPT - decryption of data”h]”hŒ#ALG_OP_DECRYPT - decryption of data”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kñhj˜ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj}ubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´Kïhjkubeh}”(h]”h ]”h"]”h$]”h&]”uh1j#hjhh²hh³Nh´Nubj$)�”}”(hŒDspecification of the IV information marked with the flag ALG_SET_IV ”h]”hë)�”}”(hŒCspecification of the IV information marked with the flag ALG_SET_IV”h]”hŒCspecification of the IV information marked with the flag ALG_SET_IV”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kóhj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjhh²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´Kíhjh²hubhë)�”}”(hŒFThe send system call family allows the following flag to be specified:”h]”hŒFThe send system call family allows the following flag to be specified:”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kõhjh²hubj)�”}”(hhh]”j$)�”}”(hŒ¯MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call. ”h]”hë)�”}”(hŒ®MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call.”h]”hŒ®MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call.”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´K÷hjëubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjèh²hh³hÃh´Nubah}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´K÷hjh²hubhë)�”}”(hŒ¨Note: The kernel reports -EINVAL for any unexpected data. The caller must make sure that all data matches the constraints given in /proc/crypto for the selected cipher.”h]”hŒ¨Note: The kernel reports -EINVAL for any unexpected data. The caller must make sure that all data matches the constraints given in /proc/crypto for the selected cipher.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kûhjh²hubhë)�”}”(hXFWith the recv() system call, the application can read the result of the cipher operation from the kernel crypto API. The output buffer must be at least as large as to hold all blocks of the encrypted or decrypted data. If the output data size is smaller, only as many blocks are returned that fit into that output buffer size.”h]”hXFWith the recv() system call, the application can read the result of the cipher operation from the kernel crypto API. The output buffer must be at least as large as to hold all blocks of the encrypted or decrypted data. If the output data size is smaller, only as many blocks are returned that fit into that output buffer size.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Kÿhjh²hubeh}”(h]”Œsymmetric-cipher-api”ah ]”h"]”Œsymmetric cipher api”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´KÐubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒAEAD Cipher API”h]”hŒAEAD Cipher API”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj-h²hh³hÃh´Mubhë)�”}”(hŒ–The operation is very similar to the symmetric cipher discussion. During initialization, the struct sockaddr data structure must be filled as follows:”h]”hŒ–The operation is very similar to the symmetric cipher discussion. During initialization, the struct sockaddr data structure must be filled as follows:”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mhj-h²hubj¥)�”}”(hŒ³struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "aead", /* this selects the symmetric cipher */ .salg_name = "gcm(aes)" /* this is the cipher name */ };”h]”hŒ³struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "aead", /* this selects the symmetric cipher */ .salg_name = "gcm(aes)" /* this is the cipher name */ };”…”�”}”hjLsbah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j¤h³hÃh´Mhj-h²hubhë)�”}”(hŒ°Before data can be sent to the kernel using the write/send system call family, the consumer must set the key. The key setting is described with the setsockopt invocation below.”h]”hŒ°Before data can be sent to the kernel using the write/send system call family, the consumer must set the key. The key setting is described with the setsockopt invocation below.”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mhj-h²hubhë)�”}”(hŒñIn addition, before data can be sent to the kernel using the write/send system call family, the consumer must set the authentication tag size. To set the authentication tag size, the caller must use the setsockopt invocation described below.”h]”hŒñIn addition, before data can be sent to the kernel using the write/send system call family, the consumer must set the authentication tag size. To set the authentication tag size, the caller must use the setsockopt invocation described below.”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mhj-h²hubhë)�”}”(hŒÙUsing the sendmsg() system call, the application provides the data that should be processed for encryption or decryption. In addition, the IV is specified with the data structure provided by the sendmsg() system call.”h]”hŒÙUsing the sendmsg() system call, the application provides the data that should be processed for encryption or decryption. In addition, the IV is specified with the data structure provided by the sendmsg() system call.”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mhj-h²hubhë)�”}”(hXUThe sendmsg system call parameter of struct msghdr is embedded into the struct cmsghdr data structure. See recv(2) and cmsg(3) for more information on how the cmsghdr data structure is used together with the send/recv system call family. That cmsghdr data structure holds the following information specified with a separate header instances:”h]”hXUThe sendmsg system call parameter of struct msghdr is embedded into the struct cmsghdr data structure. See recv(2) and cmsg(3) for more information on how the cmsghdr data structure is used together with the send/recv system call family. That cmsghdr data structure holds the following information specified with a separate header instances:”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M"hj-h²hubj)�”}”(hhh]”(j$)�”}”(hŒ”specification of the cipher operation type with one of these flags: - ALG_OP_ENCRYPT - encryption of data - ALG_OP_DECRYPT - decryption of data ”h]”(hë)�”}”(hŒCspecification of the cipher operation type with one of these flags:”h]”hŒCspecification of the cipher operation type with one of these flags:”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M(hj•ubj)�”}”(hhh]”(j$)�”}”(hŒ$ALG_OP_ENCRYPT - encryption of data ”h]”hë)�”}”(hŒ#ALG_OP_ENCRYPT - encryption of data”h]”hŒ#ALG_OP_ENCRYPT - encryption of data”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M*hjªubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj§ubj$)�”}”(hŒ$ALG_OP_DECRYPT - decryption of data ”h]”hë)�”}”(hŒ#ALG_OP_DECRYPT - decryption of data”h]”hŒ#ALG_OP_DECRYPT - decryption of data”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M,hjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj§ubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M*hj•ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j#hj’h²hh³Nh´Nubj$)�”}”(hŒDspecification of the IV information marked with the flag ALG_SET_IV ”h]”hë)�”}”(hŒCspecification of the IV information marked with the flag ALG_SET_IV”h]”hŒCspecification of the IV information marked with the flag ALG_SET_IV”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M.hjæubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj’h²hh³hÃh´Nubj$)�”}”(hŒËspecification of the associated authentication data (AAD) with the flag ALG_SET_AEAD_ASSOCLEN. The AAD is sent to the kernel together with the plaintext / ciphertext. See below for the memory structure. ”h]”hë)�”}”(hŒÊspecification of the associated authentication data (AAD) with the flag ALG_SET_AEAD_ASSOCLEN. The AAD is sent to the kernel together with the plaintext / ciphertext. See below for the memory structure.”h]”hŒÊspecification of the associated authentication data (AAD) with the flag ALG_SET_AEAD_ASSOCLEN. The AAD is sent to the kernel together with the plaintext / ciphertext. See below for the memory structure.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M0hjþubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj’h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M(hj-h²hubhë)�”}”(hŒFThe send system call family allows the following flag to be specified:”h]”hŒFThe send system call family allows the following flag to be specified:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M4hj-h²hubj)�”}”(hhh]”j$)�”}”(hŒ¯MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call. ”h]”hë)�”}”(hŒ®MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call.”h]”hŒ®MSG_MORE: If this flag is set, the send system call acts like a cipher update function where more input data is expected with a subsequent invocation of the send system call.”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M6hj-ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj*h²hh³hÃh´Nubah}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M6hj-h²hubhë)�”}”(hŒ¨Note: The kernel reports -EINVAL for any unexpected data. The caller must make sure that all data matches the constraints given in /proc/crypto for the selected cipher.”h]”hŒ¨Note: The kernel reports -EINVAL for any unexpected data. The caller must make sure that all data matches the constraints given in /proc/crypto for the selected cipher.”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M:hj-h²hubhë)�”}”(hXWith the recv() system call, the application can read the result of the cipher operation from the kernel crypto API. The output buffer must be at least as large as defined with the memory structure below. If the output data size is smaller, the cipher operation is not performed.”h]”hXWith the recv() system call, the application can read the result of the cipher operation from the kernel crypto API. The output buffer must be at least as large as defined with the memory structure below. If the output data size is smaller, the cipher operation is not performed.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M>hj-h²hubhë)�”}”(hŒˆThe authenticated decryption operation may indicate an integrity error. Such breach in integrity is marked with the -EBADMSG error code.”h]”hŒˆThe authenticated decryption operation may indicate an integrity error. Such breach in integrity is marked with the -EBADMSG error code.”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MChj-h²hubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒAEAD Memory Structure”h]”hŒAEAD Memory Structure”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhjuh²hh³hÃh´MGubhë)�”}”(hŒ~The AEAD cipher operates with the following information that is communicated between user and kernel space as one data stream:”h]”hŒ~The AEAD cipher operates with the following information that is communicated between user and kernel space as one data stream:”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MIhjuh²hubj)�”}”(hhh]”(j$)�”}”(hŒplaintext or ciphertext ”h]”hë)�”}”(hŒplaintext or ciphertext”h]”hŒplaintext or ciphertext”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MLhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj”h²hh³hÃh´Nubj$)�”}”(hŒ%associated authentication data (AAD) ”h]”hë)�”}”(hŒ$associated authentication data (AAD)”h]”hŒ$associated authentication data (AAD)”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MNhj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj”h²hh³hÃh´Nubj$)�”}”(hŒauthentication tag ”h]”hë)�”}”(hŒauthentication tag”h]”hŒauthentication tag”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MPhjÇubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj”h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´MLhjuh²hubhë)�”}”(hXThe sizes of the AAD and the authentication tag are provided with the sendmsg and setsockopt calls (see there). As the kernel knows the size of the entire data stream, the kernel is now able to calculate the right offsets of the data components in the data stream.”h]”hXThe sizes of the AAD and the authentication tag are provided with the sendmsg and setsockopt calls (see there). As the kernel knows the size of the entire data stream, the kernel is now able to calculate the right offsets of the data components in the data stream.”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MRhjuh²hubhë)�”}”(hŒYThe user space caller must arrange the aforementioned information in the following order:”h]”hŒYThe user space caller must arrange the aforementioned information in the following order:”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MWhjuh²hubj)�”}”(hhh]”(j$)�”}”(hŒ*AEAD encryption input: AAD \|\| plaintext ”h]”hë)�”}”(hŒ)AEAD encryption input: AAD \|\| plaintext”h]”hŒ)AEAD encryption input: AAD || plaintext”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MZhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒCAEAD decryption input: AAD \|\| ciphertext \|\| authentication tag ”h]”hë)�”}”(hŒBAEAD decryption input: AAD \|\| ciphertext \|\| authentication tag”h]”hŒBAEAD decryption input: AAD || ciphertext || authentication tag”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M\hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´MZhjuh²hubhë)�”}”(hŒfThe output buffer the user space caller provides must be at least as large to hold the following data:”h]”hŒfThe output buffer the user space caller provides must be at least as large to hold the following data:”…”�”}”(hj: h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M^hjuh²hubj)�”}”(hhh]”(j$)�”}”(hŒ;AEAD encryption output: ciphertext \|\| authentication tag ”h]”hë)�”}”(hŒ:AEAD encryption output: ciphertext \|\| authentication tag”h]”hŒ:AEAD encryption output: ciphertext || authentication tag”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MahjK ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjH h²hh³hÃh´Nubj$)�”}”(hŒ"AEAD decryption output: plaintext ”h]”hë)�”}”(hŒ!AEAD decryption output: plaintext”h]”hŒ!AEAD decryption output: plaintext”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mchjc ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjH h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´Mahjuh²hubeh}”(h]”Œaead-memory-structure”ah ]”h"]”Œaead memory structure”ah$]”h&]”uh1hÄhj-h²hh³hÃh´MGubeh}”(h]”Œaead-cipher-api”ah ]”h"]”Œaead cipher api”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´MubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒRandom Number Generator API”h]”hŒRandom Number Generator API”…”�”}”(hj” h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj‘ h²hh³hÃh´Mfubhë)�”}”(hŒŒAgain, the operation is very similar to the other APIs. During initialization, the struct sockaddr data structure must be filled as follows:”h]”hŒŒAgain, the operation is very similar to the other APIs. During initialization, the struct sockaddr data structure must be filled as follows:”…”�”}”(hj¢ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mhhj‘ h²hubj¥)�”}”(hŒ´struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "rng", /* this selects the random number generator */ .salg_name = "stdrng" /* this is the RNG name */ };”h]”hŒ´struct sockaddr_alg sa = { .salg_family = AF_ALG, .salg_type = "rng", /* this selects the random number generator */ .salg_name = "stdrng" /* this is the RNG name */ };”…”�”}”hj° sbah}”(h]”h ]”h"]”h$]”h&]”j´jµuh1j¤h³hÃh´Mnhj‘ h²hubhë)�”}”(hXDepending on the RNG type, the RNG must be seeded. The seed is provided using the setsockopt interface to set the key. The SP800-90A DRBGs do not require a seed, but may be seeded. The seed is also known as a *Personalization String* in NIST SP 800-90A standard.”h]”(hŒÑDepending on the RNG type, the RNG must be seeded. The seed is provided using the setsockopt interface to set the key. The SP800-90A DRBGs do not require a seed, but may be seeded. The seed is also known as a ”…”�”}”(hj¾ h²hh³Nh´Nubj÷)�”}”(hŒ*Personalization String*”h]”hŒPersonalization String”…”�”}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj¾ ubhŒ in NIST SP 800-90A standard.”…”�”}”(hj¾ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Muhj‘ h²hubhë)�”}”(hŒÏUsing the read()/recvmsg() system calls, random numbers can be obtained. The kernel generates at most 128 bytes in one call. If user space requires more data, multiple calls to read()/recvmsg() must be made.”h]”hŒÏUsing the read()/recvmsg() system calls, random numbers can be obtained. The kernel generates at most 128 bytes in one call. If user space requires more data, multiple calls to read()/recvmsg() must be made.”…”�”}”(hjÞ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mzhj‘ h²hubhë)�”}”(hŒ¥WARNING: The user space caller may invoke the initially mentioned accept system call multiple times. In this case, the returned file descriptors have the same state.”h]”hŒ¥WARNING: The user space caller may invoke the initially mentioned accept system call multiple times. In this case, the returned file descriptors have the same state.”…”�”}”(hjì h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M~hj‘ h²hubhë)�”}”(hŒhFollowing CAVP testing interfaces are enabled when kernel is built with CRYPTO_USER_API_RNG_CAVP option:”h]”hŒhFollowing CAVP testing interfaces are enabled when kernel is built with CRYPTO_USER_API_RNG_CAVP option:”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M‚hj‘ h²hubj)�”}”(hhh]”(j$)�”}”(hŒ¬the concatenation of *Entropy* and *Nonce* can be provided to the RNG via ALG_SET_DRBG_ENTROPY setsockopt interface. Setting the entropy requires CAP_SYS_ADMIN permission. ”h]”hë)�”}”(hŒ«the concatenation of *Entropy* and *Nonce* can be provided to the RNG via ALG_SET_DRBG_ENTROPY setsockopt interface. Setting the entropy requires CAP_SYS_ADMIN permission.”h]”(hŒthe concatenation of ”…”�”}”(hj h²hh³Nh´Nubj÷)�”}”(hŒ *Entropy*”h]”hŒEntropy”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj ubhŒ and ”…”�”}”(hj h²hh³Nh´Nubj÷)�”}”(hŒ*Nonce*”h]”hŒNonce”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj ubhŒ� can be provided to the RNG via ALG_SET_DRBG_ENTROPY setsockopt interface. Setting the entropy requires CAP_SYS_ADMIN permission.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M…hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubj$)�”}”(hŒt*Additional Data* can be provided using the send()/sendmsg() system calls, but only after the entropy has been set. ”h]”hë)�”}”(hŒs*Additional Data* can be provided using the send()/sendmsg() system calls, but only after the entropy has been set.”h]”(j÷)�”}”(hŒ*Additional Data*”h]”hŒAdditional Data”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhjK ubhŒb can be provided using the send()/sendmsg() system calls, but only after the entropy has been set.”…”�”}”(hjK h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M‰hjG ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hj h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M…hj‘ h²hubeh}”(h]”Œrandom-number-generator-api”ah ]”h"]”Œrandom number generator api”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´MfubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒZero-Copy Interface”h]”hŒZero-Copy Interface”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj{ h²hh³hÃh´M�ubhë)�”}”(hX&AF_ALG used to have zero-copy support, but it was removed due to it being a frequent source of vulnerabilities. For backwards compatibility the splice() and sendfile() system calls are still supported, but the kernel will make an internal copy of the data before passing it to the crypto code.”h]”hX&AF_ALG used to have zero-copy support, but it was removed due to it being a frequent source of vulnerabilities. For backwards compatibility the splice() and sendfile() system calls are still supported, but the kernel will make an internal copy of the data before passing it to the crypto code.”…”�”}”(hjŒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M�hj{ h²hubeh}”(h]”Œzero-copy-interface”ah ]”h"]”Œzero-copy interface”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´M�ubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒSetsockopt Interface”h]”hŒSetsockopt Interface”…”�”}”(hj¥ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj¢ h²hh³hÃh´M–ubhë)�”}”(hX‘In addition to the read/recv and send/write system call handling to send and retrieve data subject to the cipher operation, a consumer also needs to set the additional information for the cipher operation. This additional information is set using the setsockopt system call that must be invoked with the file descriptor of the open cipher (i.e. the file descriptor returned by the accept system call).”h]”hX‘In addition to the read/recv and send/write system call handling to send and retrieve data subject to the cipher operation, a consumer also needs to set the additional information for the cipher operation. This additional information is set using the setsockopt system call that must be invoked with the file descriptor of the open cipher (i.e. the file descriptor returned by the accept system call).”…”�”}”(hj³ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M˜hj¢ h²hubhë)�”}”(hŒ6Each setsockopt invocation must use the level SOL_ALG.”h]”hŒ6Each setsockopt invocation must use the level SOL_ALG.”…”�”}”(hjÁ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MŸhj¢ h²hubhë)�”}”(hŒWThe setsockopt interface allows setting the following data using the mentioned optname:”h]”hŒWThe setsockopt interface allows setting the following data using the mentioned optname:”…”�”}”(hjÏ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¡hj¢ h²hubj)�”}”(hhh]”(j$)�”}”(hŒåALG_SET_KEY -- Setting the key. Key setting is applicable to: - the skcipher cipher type (symmetric ciphers) - the hash cipher type (keyed message digests) - the AEAD cipher type - the RNG cipher type to provide the seed ”h]”(hë)�”}”(hŒ=ALG_SET_KEY -- Setting the key. Key setting is applicable to:”h]”hŒ=ALG_SET_KEY -- Setting the key. Key setting is applicable to:”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¤hjà ubj)�”}”(hhh]”(j$)�”}”(hŒ-the skcipher cipher type (symmetric ciphers) ”h]”hë)�”}”(hŒ,the skcipher cipher type (symmetric ciphers)”h]”hŒ,the skcipher cipher type (symmetric ciphers)”…”�”}”(hjù h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¦hjõ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjò ubj$)�”}”(hŒ-the hash cipher type (keyed message digests) ”h]”hë)�”}”(hŒ,the hash cipher type (keyed message digests)”h]”hŒ,the hash cipher type (keyed message digests)”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¨hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjò ubj$)�”}”(hŒthe AEAD cipher type ”h]”hë)�”}”(hŒthe AEAD cipher type”h]”hŒthe AEAD cipher type”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´Mªhj% ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjò ubj$)�”}”(hŒ(the RNG cipher type to provide the seed ”h]”hë)�”}”(hŒ'the RNG cipher type to provide the seed”h]”hŒ'the RNG cipher type to provide the seed”…”�”}”(hjA h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¬hj= ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjò ubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M¦hjà ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j#hjÝ h²hh³Nh´Nubj$)�”}”(hX”ALG_SET_KEY_BY_KEY_SERIAL -- Setting the key via keyring key_serial_t. This operation behaves the same as ALG_SET_KEY. The decrypted data is copied from a keyring key, and uses that data as the key for symmetric encryption. The passed in key_serial_t must have the KEY_(POS|USR|GRP|OTH)_SEARCH permission set, otherwise -EPERM is returned. Supports key types: user, logon, encrypted, and trusted. ”h]”hŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hXŽALG_SET_KEY_BY_KEY_SERIAL -- Setting the key via keyring key_serial_t. This operation behaves the same as ALG_SET_KEY. The decrypted data is copied from a keyring key, and uses that data as the key for symmetric encryption. The passed in key_serial_t must have the KEY_(POS|USR|GRP|OTH)_SEARCH permission set, otherwise -EPERM is returned. Supports key types: user, logon, encrypted, and trusted. ”h]”(hŒterm”“”)�”}”(hŒFALG_SET_KEY_BY_KEY_SERIAL -- Setting the key via keyring key_serial_t.”h]”hŒFALG_SET_KEY_BY_KEY_SERIAL -- Setting the key via keyring key_serial_t.”…”�”}”(hjr h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jp h³hÃh´Mµhjl ubhŒ definition”“”)�”}”(hhh]”(hë)�”}”(hŒ˜This operation behaves the same as ALG_SET_KEY. The decrypted data is copied from a keyring key, and uses that data as the key for symmetric encryption.”h]”hŒ˜This operation behaves the same as ALG_SET_KEY. The decrypted data is copied from a keyring key, and uses that data as the key for symmetric encryption.”…”�”}”(hj… h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M¯hj‚ ubhë)�”}”(hŒ¬The passed in key_serial_t must have the KEY_(POS|USR|GRP|OTH)_SEARCH permission set, otherwise -EPERM is returned. Supports key types: user, logon, encrypted, and trusted.”h]”hŒ¬The passed in key_serial_t must have the KEY_(POS|USR|GRP|OTH)_SEARCH permission set, otherwise -EPERM is returned. Supports key types: user, logon, encrypted, and trusted.”…”�”}”(hj“ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M³hj‚ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j€ hjl ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jj h³hÃh´Mµhjg ubah}”(h]”h ]”h"]”h$]”h&]”uh1je hja ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjÝ h²hh³Nh´Nubj$)�”}”(hXGALG_SET_AEAD_AUTHSIZE -- Setting the authentication tag size for AEAD ciphers. For a encryption operation, the authentication tag of the given size will be generated. For a decryption operation, the provided ciphertext is assumed to contain an authentication tag of the given size (see section about AEAD memory layout below). ”h]”hë)�”}”(hXFALG_SET_AEAD_AUTHSIZE -- Setting the authentication tag size for AEAD ciphers. For a encryption operation, the authentication tag of the given size will be generated. For a decryption operation, the provided ciphertext is assumed to contain an authentication tag of the given size (see section about AEAD memory layout below).”h]”hXFALG_SET_AEAD_AUTHSIZE -- Setting the authentication tag size for AEAD ciphers. For a encryption operation, the authentication tag of the given size will be generated. For a decryption operation, the provided ciphertext is assumed to contain an authentication tag of the given size (see section about AEAD memory layout below).”…”�”}”(hj½ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M·hj¹ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjÝ h²hh³hÃh´Nubj$)�”}”(hŒALG_SET_DRBG_ENTROPY -- Setting the entropy of the random number generator. This option is applicable to RNG cipher type only. ”h]”hë)�”}”(hŒ~ALG_SET_DRBG_ENTROPY -- Setting the entropy of the random number generator. This option is applicable to RNG cipher type only.”h]”hŒ~ALG_SET_DRBG_ENTROPY -- Setting the entropy of the random number generator. This option is applicable to RNG cipher type only.”…”�”}”(hjÕ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´M½hjÑ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j#hjÝ h²hh³hÃh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÈjÉuh1jh³hÃh´M¤hj¢ h²hubeh}”(h]”Œsetsockopt-interface”ah ]”h"]”Œsetsockopt interface”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´M–ubhÅ)�”}”(hhh]”(hÊ)�”}”(hŒUser space API example”h]”hŒUser space API example”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhj÷ h²hh³hÃh´MÁubhë)�”}”(hŒ¿Please see [1] for libkcapi which provides an easy-to-use wrapper around the aforementioned Netlink kernel interface. [1] also contains a test application that invokes all libkcapi API calls.”h]”hŒ¿Please see [1] for libkcapi which provides an easy-to-use wrapper around the aforementioned Netlink kernel interface. [1] also contains a test application that invokes all libkcapi API calls.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MÃhj÷ h²hubhë)�”}”(hŒ.[1] https://www.chronox.de/libkcapi/index.html”h]”(hŒ[1] ”…”�”}”(hj h²hh³Nh´NubjH)�”}”(hŒ*https://www.chronox.de/libkcapi/index.html”h]”hŒ*https://www.chronox.de/libkcapi/index.html”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j uh1jGhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÃh´MÇhj÷ h²hubeh}”(h]”Œuser-space-api-example”ah ]”h"]”Œuser space api example”ah$]”h&]”uh1hÄhhÆh²hh³hÃh´MÁubeh}”(h]”(Œuser-space-interface”hÂeh ]”h"]”(Œuser space interface”Œcrypto_userspace_interface”eh$]”h&]”uh1hÄhhh²hh³hÃh´KŒexpect_referenced_by_name”}”jA h·sŒexpect_referenced_by_id”}”hÂh·subeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÃuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÉNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jk Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÃŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”hÂ]”h·asŒnameids”}”(jA hÂj@ j= j†jƒj jjKjHj€j}jj j*j'jŽ j‹ j† jƒ jx ju jŸ jœ jô jñ j8 j5 uŒ nametypes”}”(jA ˆj@ ‰j†‰j ‰jK‰j€‰j‰j*‰jŽ ‰j† ‰jx ‰jŸ ‰jô ‰j8 ‰uh}”(hÂhÆj= hÆjƒhÙjj‰jHjj}jNj jƒj'jj‹ j-jƒ juju j‘ jœ j{ jñ j¢ j5 j÷ uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)�”}”(hhh]”hë)�”}”(hhh]”hŒ@Hyperlink target "crypto-userspace-interface" is not referenced.”…”�”}”hjÕ sbah}”(h]”h ]”h"]”h$]”h&]”uh1hêhjÒ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÃŒline”Kuh1jÐ ubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.