sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/crypto/api-rngmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/crypto/api-rngmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/crypto/api-rngmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/crypto/api-rngmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/crypto/api-rngmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/crypto/api-rngmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h#Random Number Algorithm Definitionsh]h#Random Number Algorithm Definitions}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhj:ubj)}(hhh]j6)}(h cipher handleh]h cipher handle}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjUhKhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhKhj7ubj)}(h7``u8 *rdata`` output buffer holding the random numbers h](j)}(h ``u8 *rdata``h]j)}(hjyh]h u8 *rdata}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjwubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjsubj)}(hhh]j6)}(h(output buffer holding the random numbersh]h(output buffer holding the random numbers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjhKhjubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjhKhj7ubj)}(h2``unsigned int dlen`` length of the output buffer h](j)}(h``unsigned int dlen``h]j)}(hjh]hunsigned int dlen}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj)}(hhh]j6)}(hlength of the output bufferh]hlength of the output buffer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhj7ubeh}(h]h ]h"]h$]h&]uh1jhjubj6)}(h**Description**h]je)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(hThis function fills the caller-allocated buffer with random numbers using the random number generator referenced by the cipher handle.h]hThis function fills the caller-allocated buffer with random numbers using the random number generator referenced by the cipher handle.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(h **Return**h]je)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(h30 function was successful; < 0 if an error occurredh]h30 function was successful; < 0 if an error occurred}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZhjhhhNhNubh)}(hhh]h}(h]h ]h"]h$]h&]entries](hČcrypto_rng_reset (C function)c.crypto_rng_resethNtauh1hhjhhhNhNubh)}(hhh](h)}(hPint crypto_rng_reset (struct crypto_rng *tfm, const u8 *seed, unsigned int slen)h]h)}(hOint crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen)h](j)}(hinth]hint}(hjYhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUhhhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKubh)}(h h]h }(hjhhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjUhhhjghKubh)}(hcrypto_rng_reseth]j)}(hcrypto_rng_reseth]hcrypto_rng_reset}(hjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubah}(h]h ](jjeh"]h$]h&]jjuh1hhjUhhhjghKubj)}(h;(struct crypto_rng *tfm, const u8 *seed, unsigned int slen)h](j)}(hstruct crypto_rng *tfmh](h)}(hhh]hstruct}(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubh)}(hhh]j)}(h crypto_rngh]h crypto_rng}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjOreftypejl reftargetjmodnameN classnameNjpjs)}jv]jy)}jlj|sbc.crypto_rng_resetasbuh1hhjubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(htfmh]htfm}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(hconst u8 *seedh](h)}(hjh]hconst}(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubh)}(hhh]j)}(hu8h]hu8}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&] refdomainjOreftypejl reftargetj(modnameN classnameNjpjs)}jv]jc.crypto_rng_resetasbuh1hhjubh)}(h h]h }(hjDhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjubj)}(hjh]h*}(hjRhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hseedh]hseed}(hj_hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(hunsigned int slenh](j)}(hunsignedh]hunsigned}(hjxhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjtubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjtubj)}(hslenh]hslen}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhjUhhhjghKubeh}(h]h ]h"]h$]h&]jjj"uh1hj#j$hjQhhhjghKubah}(h]jLah ](j(j)eh"]h$]h&]j-j.)j/huh1hhjghKhjNhhubj1)}(hhh]j6)}(hre-initialize the RNGh]hre-initialize the RNG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjhhubah}(h]h ]h"]h$]h&]uh1j0hjNhhhjghKubeh}(h]h ](jOfunctioneh"]h$]h&]jTjOjUjjVjjWjXjYuh1hhhhjhNhNubj[)}(hX$**Parameters** ``struct crypto_rng *tfm`` cipher handle ``const u8 *seed`` seed input data ``unsigned int slen`` length of the seed input data **Description** The reset function completely re-initializes the random number generator referenced by the cipher handle by clearing the current state. The new state is initialized with the caller provided seed or automatically, depending on the random number generator type (the ANSI X9.31 RNG requires caller-provided seed, the SP800-90A DRBGs perform an automatic seeding). The seed is provided as a parameter to this function call. The provided seed should have the length of the seed size defined for the random number generator as defined by crypto_rng_seedsize. **Return** 0 if the setting of the key was successful; < 0 if an error occurredh](j6)}(h**Parameters**h]je)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj)}(hhh](j)}(h)``struct crypto_rng *tfm`` cipher handle h](j)}(h``struct crypto_rng *tfm``h]j)}(hjh]hstruct crypto_rng *tfm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj)}(hhh]j6)}(h cipher handleh]h cipher handle}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1j5hj0hKhj1ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj0hKhjubj)}(h#``const u8 *seed`` seed input data h](j)}(h``const u8 *seed``h]j)}(hjTh]hconst u8 *seed}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjNubj)}(hhh]j6)}(hseed input datah]hseed input data}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjihKhjjubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]uh1jhjihKhjubj)}(h4``unsigned int slen`` length of the seed input data h](j)}(h``unsigned int slen``h]j)}(hjh]hunsigned int slen}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj)}(hhh]j6)}(hlength of the seed input datah]hlength of the seed input data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubj6)}(h**Description**h]je)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(hX(The reset function completely re-initializes the random number generator referenced by the cipher handle by clearing the current state. The new state is initialized with the caller provided seed or automatically, depending on the random number generator type (the ANSI X9.31 RNG requires caller-provided seed, the SP800-90A DRBGs perform an automatic seeding). The seed is provided as a parameter to this function call. The provided seed should have the length of the seed size defined for the random number generator as defined by crypto_rng_seedsize.h]hX(The reset function completely re-initializes the random number generator referenced by the cipher handle by clearing the current state. The new state is initialized with the caller provided seed or automatically, depending on the random number generator type (the ANSI X9.31 RNG requires caller-provided seed, the SP800-90A DRBGs perform an automatic seeding). The seed is provided as a parameter to this function call. The provided seed should have the length of the seed size defined for the random number generator as defined by crypto_rng_seedsize.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(h **Return**h]je)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(hD0 if the setting of the key was successful; < 0 if an error occurredh]hD0 if the setting of the key was successful; < 0 if an error occurred}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZhjhhhNhNubh)}(hhh]h}(h]h ]h"]h$]h&]entries](hČ crypto_rng_seedsize (C function)c.crypto_rng_seedsizehNtauh1hhjhhhNhNubh)}(hhh](h)}(h0int crypto_rng_seedsize (struct crypto_rng *tfm)h]h)}(h/int crypto_rng_seedsize(struct crypto_rng *tfm)h](j)}(hinth]hint}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0hhhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKubh)}(h h]h }(hjChhhNhNubah}(h]h ]hah"]h$]h&]uh1hhj0hhhjBhKubh)}(hcrypto_rng_seedsizeh]j)}(hcrypto_rng_seedsizeh]hcrypto_rng_seedsize}(hjUhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubah}(h]h ](jjeh"]h$]h&]jjuh1hhj0hhhjBhKubj)}(h(struct crypto_rng *tfm)h]j)}(hstruct crypto_rng *tfmh](h)}(hhh]hstruct}(hjqhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjmubh)}(h h]h }(hj~hhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjmubh)}(hhh]j)}(h crypto_rngh]h crypto_rng}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjOreftypejl reftargetjmodnameN classnameNjpjs)}jv]jy)}jljWsbc.crypto_rng_seedsizeasbuh1hhjmubh)}(h h]h }(hjhhhNhNubah}(h]h ]hah"]h$]h&]uh1hhjmubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjmubj)}(htfmh]htfm}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjmubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjiubah}(h]h ]h"]h$]h&]jjuh1jhj0hhhjBhKubeh}(h]h ]h"]h$]h&]jjj"uh1hj#j$hj,hhhjBhKubah}(h]j'ah ](j(j)eh"]h$]h&]j-j.)j/huh1hhjBhKhj)hhubj1)}(hhh]j6)}(hobtain seed size of RNGh]hobtain seed size of RNG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjhhubah}(h]h ]h"]h$]h&]uh1j0hj)hhhjBhKubeh}(h]h ](jOfunctioneh"]h$]h&]jTjOjUj jVj jWjXjYuh1hhhhjhNhNubj[)}(hX**Parameters** ``struct crypto_rng *tfm`` cipher handle **Description** The function returns the seed size for the random number generator referenced by the cipher handle. This value may be zero if the random number generator does not implement or require a reseeding. For example, the SP800-90A DRBGs implement an automated reseeding after reaching a pre-defined threshold. **Return** seed size for the random number generatorh](j6)}(h**Parameters**h]je)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj)}(hhh]j)}(h)``struct crypto_rng *tfm`` cipher handle h](j)}(h``struct crypto_rng *tfm``h]j)}(hj5h]hstruct crypto_rng *tfm}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3ubah}(h]h ]h"]h$]h&]uh1jhS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhj/ubj)}(hhh]j6)}(h cipher handleh]h cipher handle}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hjJhKhjKubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhjJhKhj,ubah}(h]h ]h"]h$]h&]uh1jhjubj6)}(h**Description**h]je)}(hjph]h Description}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjnubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(hX.The function returns the seed size for the random number generator referenced by the cipher handle. This value may be zero if the random number generator does not implement or require a reseeding. For example, the SP800-90A DRBGs implement an automated reseeding after reaching a pre-defined threshold.h]hX.The function returns the seed size for the random number generator referenced by the cipher handle. This value may be zero if the random number generator does not implement or require a reseeding. For example, the SP800-90A DRBGs implement an automated reseeding after reaching a pre-defined threshold. }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(h **Return**h]je)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubj6)}(h)seed size for the random number generatorh]h)seed size for the random number generator}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j5hS/var/lib/git/docbuild/linux/Documentation/crypto/api-rng:13: ./include/crypto/rng.hhKhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZhjhhhNhNubeh}(h]crypto-api-random-number-apiah ]h"]crypto api random number apiah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjju nametypes}(jjuh}(jhhhjjj*j/j8j=jj j j j j jLjQj'j,u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.