\hypertarget{arc4random_8c_source}{}\doxysection{arc4random.\+c}
\label{arc4random_8c_source}\index{libkern/arc4random.c@{libkern/arc4random.c}}
\mbox{\hyperlink{arc4random_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00001}\mbox{\hyperlink{arc4random_8c_a24bdd92b6cf8d141a4a27d4882c6a905}{00001}} \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00002}\mbox{\hyperlink{arc4random_8c_a7c3206193fd117742ab3a6a0ff890983}{00002}} \textcolor{comment}{ * Copyright (c) 2017 The FreeBSD Foundation}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00003}\mbox{\hyperlink{arc4random_8c_ab0baee338665deda94527efc3315cfdc}{00003}} \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00004}\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{00004}} \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00009}00009 \textcolor{comment}{ *    in this position and unchanged.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00010}00010 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00012}00012 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00014}00014 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00016}00016 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00017}00017 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00018}00018 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00019}00019 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00020}00020 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00021}00021 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00022}00022 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00025}00025 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00026}00026 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00027}00027 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00028}\mbox{\hyperlink{arc4random_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00028}} \mbox{\hyperlink{arc4random_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/libkern.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/linker.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/msan.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/random.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/smp.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/time.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <machine/cpu.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <crypto/chacha20/chacha.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <crypto/sha2/sha256.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <dev/random/randomdev.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00048}00048 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <dev/random/fenestrasX/fx\_pub.h>}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00050}00050 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00052}\mbox{\hyperlink{arc4random_8c_a920a3883b58b7c110167bb5ea5401997}{00052}} \textcolor{preprocessor}{\#define CHACHA20\_RESEED\_BYTES   65536}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00053}\mbox{\hyperlink{arc4random_8c_af1ef0c92066e02dff037995492f73413}{00053}} \textcolor{preprocessor}{\#define CHACHA20\_RESEED\_SECONDS 300}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00054}\mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{00054}} \textcolor{preprocessor}{\#define CHACHA20\_KEYBYTES       32}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00055}\mbox{\hyperlink{arc4random_8c_a7dc5a140313fd85cc890b0a17b8f44e3}{00055}} \textcolor{preprocessor}{\#define CHACHA20\_BUFFER\_SIZE    64}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00057}\mbox{\hyperlink{arc4random_8c_a8cea6facc0b2dc0687b8e8706021c39a}{00057}} \mbox{\hyperlink{arc4random_8c_a8cea6facc0b2dc0687b8e8706021c39a}{CTASSERT}}(\mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{CHACHA20\_KEYBYTES}}*8 >= CHACHA\_MINKEYLEN);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00059}00059 \textcolor{preprocessor}{\#ifndef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00060}\mbox{\hyperlink{arc4random_8c_aedb4065360c3afdb04ff4689d7b596d7}{00060}} \textcolor{keywordtype}{int} \mbox{\hyperlink{arc4random_8c_aedb4065360c3afdb04ff4689d7b596d7}{arc4rand\_iniseed\_state}} = ARC4\_ENTR\_NONE;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00061}00061 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00063}\mbox{\hyperlink{arc4random_8c_ae3f7b9f0a182a2ad1dcb4549b19381a4}{00063}} \mbox{\hyperlink{arc4random_8c_a30251da6f0b3b3b166e751c10b4f516e}{MALLOC\_DEFINE}}(M\_CHACHA20RANDOM, \textcolor{stringliteral}{"{}chacha20random"{}}, \textcolor{stringliteral}{"{}chacha20random structures"{}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00065}\mbox{\hyperlink{structchacha20__s}{00065}} \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s}{chacha20\_s}} \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00066}\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{00066}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}} \mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00067}\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{00067}}         \textcolor{keywordtype}{int} \mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00068}\mbox{\hyperlink{structchacha20__s_a6a310d80015f885ed3c8018dd9c8e8f7}{00068}}         time\_t \mbox{\hyperlink{structchacha20__s_a6a310d80015f885ed3c8018dd9c8e8f7}{t\_reseed}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00069}\mbox{\hyperlink{structchacha20__s_adc111ff8b86b0e1878be31d7a16d7854}{00069}}         uint8\_t \mbox{\hyperlink{structchacha20__s_adc111ff8b86b0e1878be31d7a16d7854}{m\_buffer}}[\mbox{\hyperlink{arc4random_8c_a7dc5a140313fd85cc890b0a17b8f44e3}{CHACHA20\_BUFFER\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00070}\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{00070}}         \textcolor{keyword}{struct }chacha\_ctx \mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00071}00071 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00072}00072         uint64\_t seed\_version;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00073}00073 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00074}00074 \} \mbox{\hyperlink{arc4random_8c_ae3f7b9f0a182a2ad1dcb4549b19381a4}{\_\_aligned}}(CACHE\_LINE\_SIZE);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00076}\mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{00076}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s}{chacha20\_s}} *\mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{chacha20inst}} = NULL;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00078}\mbox{\hyperlink{arc4random_8c_a97beb6da38bd08c00e73c139a2b48905}{00078}} \textcolor{preprocessor}{\#define CHACHA20\_FOREACH(\_chacha20) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00079}00079 \textcolor{preprocessor}{        for (\_chacha20 = \&chacha20inst[0]; \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00080}00080 \textcolor{preprocessor}{             \_chacha20 <= \&chacha20inst[mp\_maxid]; \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00081}00081 \textcolor{preprocessor}{             \_chacha20++)}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00083}00083 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00084}00084 \textcolor{comment}{ * Mix up the current context.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00085}00085 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00086}00086 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00087}\mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{00087}} \mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{chacha20\_randomstir}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structchacha20__s}{chacha20\_s}} *chacha20)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00088}00088 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00089}00089         \textcolor{keyword}{struct }timeval tv\_now;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00090}00090         uint8\_t key[\mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{CHACHA20\_KEYBYTES}}];}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00091}00091 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00092}00092         uint64\_t seed\_version;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00094}00094 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00095}00095         \textcolor{keywordflow}{if} (\_\_predict\_false(random\_bypass\_before\_seeding \&\& !is\_random\_seeded())) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00096}00096                 SHA256\_CTX \mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00097}00097                 uint64\_t cc;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00098}00098                 uint32\_t fver;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00100}00100                 \textcolor{keywordflow}{if} (!arc4random\_bypassed\_before\_seeding) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00101}00101                         arc4random\_bypassed\_before\_seeding = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00102}00102                         \textcolor{keywordflow}{if} (!random\_bypass\_disable\_warnings)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00103}00103                                 printf(\textcolor{stringliteral}{"{}arc4random: WARNING: initial seeding "{}}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00104}00104                                     \textcolor{stringliteral}{"{}bypassed the cryptographic random device "{}}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00105}00105                                     \textcolor{stringliteral}{"{}because it was not yet seeded and the "{}}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00106}00106                                     \textcolor{stringliteral}{"{}knob 'bypass\_before\_seeding' was "{}}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00107}00107                                     \textcolor{stringliteral}{"{}enabled.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00108}00108                 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00110}00110                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00111}00111 \textcolor{comment}{                 * "{}key"{} is intentionally left uninitialized here, so with KMSAN}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00112}00112 \textcolor{comment}{                 * enabled the arc4random() return value may be marked}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00113}00113 \textcolor{comment}{                 * uninitialized, leading to spurious reports.  Lie to KMSAN to}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00114}00114 \textcolor{comment}{                 * avoid this situation.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00115}00115 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00116}00116                 kmsan\_mark(key, \textcolor{keyword}{sizeof}(key), KMSAN\_STATE\_INITED);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00118}00118                 \textcolor{comment}{/* Last ditch effort to inject something in a bad condition. */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00119}00119                 cc = get\_cyclecount();}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00120}00120                 SHA256\_Init(\&\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00121}00121                 SHA256\_Update(\&\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}}, key, \textcolor{keyword}{sizeof}(key));}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00122}00122                 SHA256\_Update(\&\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}}, \&cc, \textcolor{keyword}{sizeof}(cc));}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00123}00123                 fver = \_\_FreeBSD\_version;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00124}00124                 SHA256\_Update(\&\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}}, \&fver, \textcolor{keyword}{sizeof}(fver));}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00125}00125                 \_Static\_assert(\textcolor{keyword}{sizeof}(key) == SHA256\_DIGEST\_LENGTH,}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00126}00126                     \textcolor{stringliteral}{"{}make sure 256 bits is still 256 bits"{}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00127}00127                 SHA256\_Final(key, \&\mbox{\hyperlink{arc4random_8c_a39ce9c0721b213ba617e3206c8883665}{ctx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00128}00128         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00129}00129 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00130}00130 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00131}00131                 read\_random\_key(key, \mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{CHACHA20\_KEYBYTES}}, \&seed\_version);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00132}00132 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00133}00133                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00134}00134 \textcolor{comment}{                * If the loader(8) did not have an entropy stash from the}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00135}00135 \textcolor{comment}{                * previous shutdown to load, then we will block.  The answer is}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00136}00136 \textcolor{comment}{                * to make sure there is an entropy stash at shutdown time.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00137}00137 \textcolor{comment}{                *}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00138}00138 \textcolor{comment}{                * On the other hand, if the random\_bypass\_before\_seeding knob}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00139}00139 \textcolor{comment}{                * was set and we landed in this branch, we know this won't}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00140}00140 \textcolor{comment}{                * block because we know the random device is seeded.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00141}00141 \textcolor{comment}{                */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00142}00142                 read\_random(key, \mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{CHACHA20\_KEYBYTES}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00143}00143         \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00144}00144 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00145}00145         getmicrouptime(\&tv\_now);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00146}00146         mtx\_lock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00147}00147         chacha\_keysetup(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}}, key, \mbox{\hyperlink{arc4random_8c_a4e23b7de217e0636841f68a8138160f2}{CHACHA20\_KEYBYTES}}*8);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00148}00148         chacha\_ivsetup(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}}, (u\_char *)\&tv\_now.tv\_sec, (u\_char *)\&tv\_now.tv\_usec);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00149}00149         \textcolor{comment}{/* Reset for next reseed cycle. */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00150}00150         chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6a310d80015f885ed3c8018dd9c8e8f7}{t\_reseed}} = tv\_now.tv\_sec + \mbox{\hyperlink{arc4random_8c_af1ef0c92066e02dff037995492f73413}{CHACHA20\_RESEED\_SECONDS}};}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00151}00151         chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}} = 0;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00152}00152 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00153}00153         chacha20-\/>seed\_version = seed\_version;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00154}00154 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00155}00155         mtx\_unlock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00156}00156 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00158}00158 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00159}00159 \textcolor{comment}{ * Initialize the contexts.}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00160}00160 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00161}00161 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00162}\mbox{\hyperlink{arc4random_8c_ac251a508aebce13a9bbd9c8d8d4bd098}{00162}} \mbox{\hyperlink{arc4random_8c_ac251a508aebce13a9bbd9c8d8d4bd098}{chacha20\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00163}00163 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00164}00164         \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s}{chacha20\_s}} *chacha20;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00166}00166         \mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{chacha20inst}} = malloc((mp\_maxid + 1) * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structchacha20__s}{chacha20\_s}}),}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00167}00167                         M\_CHACHA20RANDOM, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00168}00168         KASSERT(\mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{chacha20inst}} != NULL, (\textcolor{stringliteral}{"{}chacha20\_init: memory allocation error"{}}));}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00170}00170         \mbox{\hyperlink{arc4random_8c_a97beb6da38bd08c00e73c139a2b48905}{CHACHA20\_FOREACH}}(chacha20) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00171}00171                 mtx\_init(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}}, \textcolor{stringliteral}{"{}chacha20\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00172}00172                 chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6a310d80015f885ed3c8018dd9c8e8f7}{t\_reseed}} = -\/1;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00173}00173                 chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}} = 0;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00174}00174                 \mbox{\hyperlink{explicit__bzero_8c_a779ca5d71ac4f20477a480975fd18f48}{explicit\_bzero}}(chacha20-\/>\mbox{\hyperlink{structchacha20__s_adc111ff8b86b0e1878be31d7a16d7854}{m\_buffer}}, \mbox{\hyperlink{arc4random_8c_a7dc5a140313fd85cc890b0a17b8f44e3}{CHACHA20\_BUFFER\_SIZE}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00175}00175                 \mbox{\hyperlink{explicit__bzero_8c_a779ca5d71ac4f20477a480975fd18f48}{explicit\_bzero}}(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}}, \textcolor{keyword}{sizeof}(chacha20-\/>\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}}));}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00176}00176         \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00177}00177 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00178}\mbox{\hyperlink{arc4random_8c_a0583f735931c268ffde44c1172bff601}{00178}} \mbox{\hyperlink{arc4random_8c_a0583f735931c268ffde44c1172bff601}{SYSINIT}}(chacha20, SI\_SUB\_LOCK, SI\_ORDER\_ANY, \mbox{\hyperlink{arc4random_8c_ac251a508aebce13a9bbd9c8d8d4bd098}{chacha20\_init}}, NULL);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00181}00181 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00182}\mbox{\hyperlink{arc4random_8c_afc712371815b2544e326034f66f8d10c}{00182}} \mbox{\hyperlink{arc4random_8c_afc712371815b2544e326034f66f8d10c}{chacha20\_uninit}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00183}00183 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00184}00184         \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s}{chacha20\_s}} *chacha20;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00186}00186         \mbox{\hyperlink{arc4random_8c_a97beb6da38bd08c00e73c139a2b48905}{CHACHA20\_FOREACH}}(chacha20)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00187}00187                 mtx\_destroy(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00188}00188         free(\mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{chacha20inst}}, M\_CHACHA20RANDOM);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00189}00189 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00190}\mbox{\hyperlink{arc4random_8c_aca823be79d0e3a1b49e86dc0a46b5474}{00190}} \mbox{\hyperlink{arc4random_8c_aca823be79d0e3a1b49e86dc0a46b5474}{SYSUNINIT}}(chacha20, SI\_SUB\_LOCK, SI\_ORDER\_ANY, \mbox{\hyperlink{arc4random_8c_afc712371815b2544e326034f66f8d10c}{chacha20\_uninit}}, NULL);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00193}00193 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00194}00194 \textcolor{comment}{ * MPSAFE}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00195}00195 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00196}00196 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00197}\mbox{\hyperlink{arc4random_8c_ab628c6443ef7017cd3cf89628f8040b5}{00197}} \mbox{\hyperlink{arc4random_8c_ab628c6443ef7017cd3cf89628f8040b5}{arc4rand}}(\textcolor{keywordtype}{void} *ptr, u\_int len, \textcolor{keywordtype}{int} reseed)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00198}00198 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00199}00199         \textcolor{keyword}{struct }\mbox{\hyperlink{structchacha20__s}{chacha20\_s}} *chacha20;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00200}00200         \textcolor{keyword}{struct }timeval tv;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00201}00201         u\_int length;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00202}00202         uint8\_t *p;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00204}00204 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00205}00205         \textcolor{keywordflow}{if} (\_\_predict\_false(reseed))}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00206}00206 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00207}00207         \textcolor{keywordflow}{if} (\_\_predict\_false(reseed ||}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00208}00208             (\mbox{\hyperlink{arc4random_8c_aedb4065360c3afdb04ff4689d7b596d7}{arc4rand\_iniseed\_state}} == ARC4\_ENTR\_HAVE \&\&}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00209}00209             atomic\_cmpset\_int(\&\mbox{\hyperlink{arc4random_8c_aedb4065360c3afdb04ff4689d7b596d7}{arc4rand\_iniseed\_state}}, ARC4\_ENTR\_HAVE, ARC4\_ENTR\_SEED))))}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00210}00210 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00211}00211                 \mbox{\hyperlink{arc4random_8c_a97beb6da38bd08c00e73c139a2b48905}{CHACHA20\_FOREACH}}(chacha20)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00212}00212                         \mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{chacha20\_randomstir}}(chacha20);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00214}00214         getmicrouptime(\&tv);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00215}00215         chacha20 = \&\mbox{\hyperlink{arc4random_8c_a5a99fe9e34ce0b7daa6de324087a60e9}{chacha20inst}}[curcpu];}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00216}00216         \textcolor{comment}{/* We may get unlucky and be migrated off this CPU, but that is expected to be infrequent */}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00217}00217         \textcolor{keywordflow}{if} ((chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}} > \mbox{\hyperlink{arc4random_8c_a920a3883b58b7c110167bb5ea5401997}{CHACHA20\_RESEED\_BYTES}}) || (tv.tv\_sec > chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6a310d80015f885ed3c8018dd9c8e8f7}{t\_reseed}}))}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00218}00218                 \mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{chacha20\_randomstir}}(chacha20);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00220}00220         mtx\_lock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00221}00221 \textcolor{preprocessor}{\#ifdef RANDOM\_FENESTRASX}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00222}00222         \textcolor{keywordflow}{if} (\_\_predict\_false(}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00223}00223             atomic\_load\_acq\_64(\&fxrng\_root\_generation) != chacha20-\/>seed\_version}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00224}00224             )) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00225}00225                 mtx\_unlock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00226}00226                 \mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{chacha20\_randomstir}}(chacha20);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00227}00227                 mtx\_lock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00228}00228         \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00229}00229 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00231}00231         p = ptr;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00232}00232         \textcolor{keywordflow}{while} (len) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00233}00233                 length = MIN(\mbox{\hyperlink{arc4random_8c_a7dc5a140313fd85cc890b0a17b8f44e3}{CHACHA20\_BUFFER\_SIZE}}, len);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00234}00234                 chacha\_encrypt\_bytes(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_ac962ff80ba2c42e53ac357749c3f160e}{ctx}}, chacha20-\/>\mbox{\hyperlink{structchacha20__s_adc111ff8b86b0e1878be31d7a16d7854}{m\_buffer}}, p, length);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00235}00235                 p += length;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00236}00236                 len -\/= length;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00237}00237                 chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}} += length;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00238}00238                 \textcolor{keywordflow}{if} (chacha20-\/>\mbox{\hyperlink{structchacha20__s_a6fe614d029120587a0318f0190e8adc5}{numbytes}} > \mbox{\hyperlink{arc4random_8c_a920a3883b58b7c110167bb5ea5401997}{CHACHA20\_RESEED\_BYTES}}) \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00239}00239                         mtx\_unlock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00240}00240                         \mbox{\hyperlink{arc4random_8c_aadde7c3564b4677a42aa6342fed3ece3}{chacha20\_randomstir}}(chacha20);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00241}00241                         mtx\_lock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00242}00242                 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00243}00243         \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00244}00244         mtx\_unlock(\&chacha20-\/>\mbox{\hyperlink{structchacha20__s_a0098adbd10b9bfdcce4547adae727487}{mtx}});}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00245}00245 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00247}00247 uint32\_t}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00248}\mbox{\hyperlink{arc4random_8c_a01532506197a21188c6c792062ee5ff1}{00248}} \mbox{\hyperlink{arc4random_8c_a01532506197a21188c6c792062ee5ff1}{arc4random}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00249}00249 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00250}00250         uint32\_t ret;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00252}00252         \mbox{\hyperlink{arc4random_8c_ab628c6443ef7017cd3cf89628f8040b5}{arc4rand}}(\&ret, \textcolor{keyword}{sizeof}(ret), 0);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00253}00253         \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00254}00254 \}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00256}00256 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00257}\mbox{\hyperlink{arc4random_8c_aede424cdd3f40500015acf72004c3c67}{00257}} \mbox{\hyperlink{arc4random_8c_aede424cdd3f40500015acf72004c3c67}{arc4random\_buf}}(\textcolor{keywordtype}{void} *ptr, \textcolor{keywordtype}{size\_t} len)}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00258}00258 \{}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00260}00260         \mbox{\hyperlink{arc4random_8c_ab628c6443ef7017cd3cf89628f8040b5}{arc4rand}}(ptr, len, 0);}
\DoxyCodeLine{\Hypertarget{arc4random_8c_source_l00261}00261 \}}

\end{DoxyCode}
