<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Algorithmus von Zufallszahlgeneratoren?]]></title><description><![CDATA[<p>Hi,<br />
ich studiere an der FH Elektrotechnik und muss in einer Vorlesung einen Vortrag über Pseudozufallszahlen halten. Dabei möchte ich evtl auch die Funktionsweise von Pseudozufallszahlgeneratoren, die von bestimmten Compilern mitgelifert werden (also zum Beispiel rand() unter C++), anschneiden. Ich hab bisher nur rausfinden können dass diese Funktion auf einem modularen Kongruenzgenerator basiert (also (a * x + c)mod n), allerdings meinte mein Prof, dass die Generatoren wahrscheinlich doch etwas komplexer seien.<br />
Kann mir jemand etwas zu dem Thema sagen, oder besser Links oder andere Quellen verraten, wo ich so etwas rausfinden könnte?<br />
Gruss,<br />
teelow</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/197895/algorithmus-von-zufallszahlgeneratoren</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 23:52:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/197895.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Nov 2007 19:20:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Thu, 15 Nov 2007 19:20:44 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich studiere an der FH Elektrotechnik und muss in einer Vorlesung einen Vortrag über Pseudozufallszahlen halten. Dabei möchte ich evtl auch die Funktionsweise von Pseudozufallszahlgeneratoren, die von bestimmten Compilern mitgelifert werden (also zum Beispiel rand() unter C++), anschneiden. Ich hab bisher nur rausfinden können dass diese Funktion auf einem modularen Kongruenzgenerator basiert (also (a * x + c)mod n), allerdings meinte mein Prof, dass die Generatoren wahrscheinlich doch etwas komplexer seien.<br />
Kann mir jemand etwas zu dem Thema sagen, oder besser Links oder andere Quellen verraten, wo ich so etwas rausfinden könnte?<br />
Gruss,<br />
teelow</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1403939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1403939</guid><dc:creator><![CDATA[teelow]]></dc:creator><pubDate>Thu, 15 Nov 2007 19:20:44 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Thu, 15 Nov 2007 20:21:34 GMT]]></title><description><![CDATA[<p><a href="http://burtleburtle.net/bob/rand/isaacafa.html" rel="nofollow">http://burtleburtle.net/bob/rand/isaacafa.html</a><br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1403983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1403983</guid><dc:creator><![CDATA[da gibt&#x27;s verdammt viel]]></dc:creator><pubDate>Thu, 15 Nov 2007 20:21:34 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Thu, 15 Nov 2007 20:33:09 GMT]]></title><description><![CDATA[<p>Jetzt wollt ich schon schreiben, dass es da nix gibt, aber dann hast du im Text ja doch noch Pseudozufallszahlgeneratoren geschrieben. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1403987</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1403987</guid><dc:creator><![CDATA[hehe]]></dc:creator><pubDate>Thu, 15 Nov 2007 20:33:09 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Thu, 15 Nov 2007 20:53:53 GMT]]></title><description><![CDATA[<p>Ein recht bekannter Pseudozufallszahlenalgorithmus ist der <a href="http://en.wikipedia.org/wiki/Mersenne_Twister" rel="nofollow">Mersenne Twister</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1403996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1403996</guid><dc:creator><![CDATA[Talla]]></dc:creator><pubDate>Thu, 15 Nov 2007 20:53:53 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Fri, 16 Nov 2007 10:09:42 GMT]]></title><description><![CDATA[<p>Lineare Kongruenzgeneratoren sind tatsächlich etwas komplizierter: x_neu = ax + b mod n hat drei Parameter a,b und n. Und wie die gewählt werden müssen, damit ein &quot;guter&quot; (was heißt hier überhaupt &quot;gut&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /> ) Generator rauskommt ist ein kompliziertes Stück Mathematik.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1404187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1404187</guid><dc:creator><![CDATA[Taurin]]></dc:creator><pubDate>Fri, 16 Nov 2007 10:09:42 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Sat, 17 Nov 2007 17:20:23 GMT]]></title><description><![CDATA[<p>Super, das hilft mir schon mal weiter, danke@all!<br />
Und kann mir vllt noch jemand sagen, auf welchen Algorithmus die normale, standardmässige rand()-Funktion in C++ basiert?<br />
Gruss<br />
teelow</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1404995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1404995</guid><dc:creator><![CDATA[teelow]]></dc:creator><pubDate>Sat, 17 Nov 2007 17:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Mon, 19 Nov 2007 14:31:00 GMT]]></title><description><![CDATA[<p>ist afaik nicht im Standard definiert. Will heißen von Compiler zu Compiler anders. Sonst schau dir mal ne opensource libc an, wie glibc oder uclibc oder so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1405935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1405935</guid><dc:creator><![CDATA[AFAIK]]></dc:creator><pubDate>Mon, 19 Nov 2007 14:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Mon, 19 Nov 2007 20:03:52 GMT]]></title><description><![CDATA[<p>okay, das hilft mir auch weiter. Nochmal thx@all!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1406152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1406152</guid><dc:creator><![CDATA[teelow]]></dc:creator><pubDate>Mon, 19 Nov 2007 20:03:52 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Mon, 19 Nov 2007 20:15:48 GMT]]></title><description><![CDATA[<p><a href="http://www.zdnet.de/security/news/0,39029460,39159132,00.htm" rel="nofollow">http://www.zdnet.de/security/news/0,39029460,39159132,00.htm</a></p>
<p>Vielleicht hilft dir das ja auch noch oder du kannst es in deinen Vortrag einbauen.</p>
<p>Hier ein Link zu einem aktuellen Thema. Stellt ganz gut dar, wie wichtig ein guter Zufallsalgorithmus für sicherheitsrelevante Zwecke ist. Finde ich erschreckend, wusste ich bis dahin auch noch nicht....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1406167</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1406167</guid><dc:creator><![CDATA[nevermore]]></dc:creator><pubDate>Mon, 19 Nov 2007 20:15:48 GMT</pubDate></item><item><title><![CDATA[Reply to Algorithmus von Zufallszahlgeneratoren? on Mon, 19 Nov 2007 20:31:34 GMT]]></title><description><![CDATA[<p>die stdlib implementierung von GNU findest du hier: <a href="ftp://ftp.gnu.org/gnu/glibc/glibc-2.7.tar.gz" rel="nofollow">ftp://ftp.gnu.org/gnu/glibc/glibc-2.7.tar.gz</a></p>
<pre><code class="language-cpp">/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
   congruential bit.  Otherwise, we do our fancy trinomial stuff, which is the
   same in all the other cases due to all the global variables that have been
   set up.  The basic operation is to add the number at the rear pointer into
   the one at the front pointer.  Then both pointers are advanced to the next
   location cyclically in the table.  The value returned is the sum generated,
   reduced to 31 bits by throwing away the &quot;least random&quot; low bit.
   Note: The code takes advantage of the fact that both the front and
   rear pointers can't wrap on the same call by not testing the rear
   pointer if the front one has wrapped.  Returns a 31-bit random number.  */

int
__random_r (buf, result)
     struct random_data *buf;
     int32_t *result;
{
  int32_t *state;

  if (buf == NULL || result == NULL)
    goto fail;

  state = buf-&gt;state;

  if (buf-&gt;rand_type == TYPE_0)
    {
      int32_t val = state[0];
      val = ((state[0] * 1103515245) + 12345) &amp; 0x7fffffff;
      state[0] = val;
      *result = val;
    }
  else
    {
      int32_t *fptr = buf-&gt;fptr;
      int32_t *rptr = buf-&gt;rptr;
      int32_t *end_ptr = buf-&gt;end_ptr;
      int32_t val;

      val = *fptr += *rptr;
      /* Chucking least random bit.  */
      *result = (val &gt;&gt; 1) &amp; 0x7fffffff;
      ++fptr;
      if (fptr &gt;= end_ptr)
	{
	  fptr = state;
	  ++rptr;
	}
      else
	{
	  ++rptr;
	  if (rptr &gt;= end_ptr)
	    rptr = state;
	}
      buf-&gt;fptr = fptr;
      buf-&gt;rptr = rptr;
    }
  return 0;

 fail:
  __set_errno (EINVAL);
  return -1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1406185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1406185</guid><dc:creator><![CDATA[borg]]></dc:creator><pubDate>Mon, 19 Nov 2007 20:31:34 GMT</pubDate></item></channel></rss>