<?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[Langzahlenmultiplikation]]></title><description><![CDATA[<p>Hallo an alle!<br />
Ich bin noch ein relativer Anfänger im Bereich des Programmierens, doch ich muss mit C++ eine Langzahlenmultiplikation programmieren!<br />
Der Algorithmus dafür ist die Schulbuch-Methode<br />
(<a href="http://www.iaik.tugraz.at/research/publications/2005/CHES2005_EES_Slides.pdf" rel="nofollow">http://www.iaik.tugraz.at/research/publications/2005/CHES2005_EES_Slides.pdf</a> ,Seite7)</p>
<p>Das sind die Definitionen(war vorgegeben)<br />
// type definition of word-level datatype<br />
typedef unsigned long bigIntType;<br />
//typedef unsigned long long bigIntType;<br />
#define BIG_INTEGER_NUM_BYTES 4<br />
#define BIG_INTEGER_NUM_NIBBLES 8<br />
#define BIG_INTEGER_NUM_BITS 32</p>
<p>// Number of words concatenated to BigInteger<br />
#define BIG_INTEGER_MAX_WORDS 8</p>
<p>Das ist der bis jetzt implementierte Code: (value und multiplier.value sind die beiden Zahlen)<br />
int tempResult[BIG_INTEGER_MAX_WORDS]={0}, mcarry;<br />
int multi1[8]= {value[0] &amp; 0xFFFF, value[0] &gt;&gt; 16 &amp; 0xFFFF};<br />
int multi2[8]= {multiplier.value[0]&amp;0xFFFF, multiplier.value[0] &gt;&gt; 16 &amp;0xFFFF};<br />
int val;<br />
for(int i = 0; i &lt; BIG_INTEGER_MAX_WORDS; i++)<br />
{<br />
mcarry = 0;<br />
for(int j = 0; j &lt; BIG_INTEGER_MAX_WORDS; j++)<br />
{</p>
<p>val = (multi1[i] * multi2[j]) + tempResult[i+j] + mcarry;<br />
tempResult[i+j] = val % 256;<br />
mcarry = val/256;<br />
}</p>
<p>tempResult[BIG_INTEGER_MAX_WORDS+i] = mcarry;<br />
}</p>
<p>return *this;</p>
<p>jo, nur irgendwie funktioniert das ganze nicht, er rechnet nicht wirklich wie ich will<br />
wäre schön wenn jemand nen Vorschlag hat, probier da jetzt schon länger herum!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/142982/langzahlenmultiplikation</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 02:02:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/142982.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Apr 2006 18:09:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Langzahlenmultiplikation on Tue, 04 Apr 2006 18:09:00 GMT]]></title><description><![CDATA[<p>Hallo an alle!<br />
Ich bin noch ein relativer Anfänger im Bereich des Programmierens, doch ich muss mit C++ eine Langzahlenmultiplikation programmieren!<br />
Der Algorithmus dafür ist die Schulbuch-Methode<br />
(<a href="http://www.iaik.tugraz.at/research/publications/2005/CHES2005_EES_Slides.pdf" rel="nofollow">http://www.iaik.tugraz.at/research/publications/2005/CHES2005_EES_Slides.pdf</a> ,Seite7)</p>
<p>Das sind die Definitionen(war vorgegeben)<br />
// type definition of word-level datatype<br />
typedef unsigned long bigIntType;<br />
//typedef unsigned long long bigIntType;<br />
#define BIG_INTEGER_NUM_BYTES 4<br />
#define BIG_INTEGER_NUM_NIBBLES 8<br />
#define BIG_INTEGER_NUM_BITS 32</p>
<p>// Number of words concatenated to BigInteger<br />
#define BIG_INTEGER_MAX_WORDS 8</p>
<p>Das ist der bis jetzt implementierte Code: (value und multiplier.value sind die beiden Zahlen)<br />
int tempResult[BIG_INTEGER_MAX_WORDS]={0}, mcarry;<br />
int multi1[8]= {value[0] &amp; 0xFFFF, value[0] &gt;&gt; 16 &amp; 0xFFFF};<br />
int multi2[8]= {multiplier.value[0]&amp;0xFFFF, multiplier.value[0] &gt;&gt; 16 &amp;0xFFFF};<br />
int val;<br />
for(int i = 0; i &lt; BIG_INTEGER_MAX_WORDS; i++)<br />
{<br />
mcarry = 0;<br />
for(int j = 0; j &lt; BIG_INTEGER_MAX_WORDS; j++)<br />
{</p>
<p>val = (multi1[i] * multi2[j]) + tempResult[i+j] + mcarry;<br />
tempResult[i+j] = val % 256;<br />
mcarry = val/256;<br />
}</p>
<p>tempResult[BIG_INTEGER_MAX_WORDS+i] = mcarry;<br />
}</p>
<p>return *this;</p>
<p>jo, nur irgendwie funktioniert das ganze nicht, er rechnet nicht wirklich wie ich will<br />
wäre schön wenn jemand nen Vorschlag hat, probier da jetzt schon länger herum!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1030510</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1030510</guid><dc:creator><![CDATA[J.E.Hoover]]></dc:creator><pubDate>Tue, 04 Apr 2006 18:09:00 GMT</pubDate></item><item><title><![CDATA[Reply to Langzahlenmultiplikation on Tue, 04 Apr 2006 18:14:40 GMT]]></title><description><![CDATA[<p>Das solltest Du in einem &quot;Hausaufgabenlösungs-Forum&quot; posten... mit MFC hat es auf jeden Fall nix zu tun.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1030521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1030521</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 04 Apr 2006 18:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to Langzahlenmultiplikation on Tue, 04 Apr 2006 18:17:11 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=709" rel="nofollow">dEUs</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1030525</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1030525</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 04 Apr 2006 18:17:11 GMT</pubDate></item></channel></rss>