<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
		<link>https://www.wolfssl.com/forums/topic879-solved-using-rsa-undefined-reference-to-wcgenerateseed-error.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic879.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error.]]></description>
		<lastBuildDate>Fri, 04 Nov 2016 21:02:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2819.html#p2819</link>
			<description><![CDATA[<p>Hi Jesussotofan,</p><p>All calls to wc_GenerateSeed are in wolfcrypt/src/random.c. There are multiple places where this function exists depending on the hardware platform. Those start at line 1133.</p><p>If you are defining CUSTOM_RAND_GENERATE_SEED then it will use the function used in that define. I&#039;d also make sure you don&#039;t have NO_DEV_RANDOM defined.</p><p>The function wc_InitRng calls wc_GenerateSeed. Make sure the wolfcrypt/src/random.c is being included with the build. Make sure you have a wc_GenerateSeed function in your random.c or use the CUSTOM_RAND_GENERATE_SEED define to remap it to your own function.</p><p>Have you seen our Arduino example for wolfSSL?<br /><a href="https://github.com/wolfSSL/wolfssl/tree/master/IDE/ARDUINO">https://github.com/wolfSSL/wolfssl/tree … DE/ARDUINO</a></p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Fri, 04 Nov 2016 21:02:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2819.html#p2819</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2818.html#p2818</link>
			<description><![CDATA[<p>Thanks for the reply.<br />The problem persists, and I think is because it is still makes the call to wc_generateSeed. The problem I don&#039;t know where the call occurs because I do not do directly. Besides, I can not quite fully understand the complex structure of wolfssl.<br />I know it sounds silly, but could you tell me where in my code makes the call to wc_generateSeed and try to change that part of the library?</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Fri, 04 Nov 2016 18:10:16 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2818.html#p2818</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2814.html#p2814</link>
			<description><![CDATA[<p>Hi Jesussotofan,</p><p>I did a search for Arduino RNG and came up with this good result:<br /><a href="https://www.arduino.cc/en/Reference/Random">https://www.arduino.cc/en/Reference/Random</a></p><p>To implement option #2 you need to add the following to your settings.h or user_settins.h (if WOLFSSL_USER_SETTINGS is defined).</p><div class="codebox"><pre><code>int rand_gen_seed(byte* output, word32 sz);
#define CUSTOM_RAND_GENERATE_SEED  rand_gen_seed</code></pre></div><p>Then the function can be put into any .c file in your project (wherever it makes sense to you).</p><p>The function would look like:</p><div class="codebox"><pre><code>int rand_gen_seed(byte* output, word32 sz)
{
    int i;
    for (i = 0; i &lt; sz; i++ ) {
        output[i] = analogRead(0);
    }

    return 0;
}</code></pre></div><p>Its important to have a good random seed, so if your micro controller has an RNG peripheral you should find example code for it and use it. The above example uses analog source 0 noise to seed the P-RNG, which is from the reference to website provided above.</p><p>Our random.c file has many references to RNG hardware implementations, so check and see if your micro-controller is already listed in there. If so you can define the value needed to enable it.</p><p>Let me know if you have any other questions.</p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Thu, 03 Nov 2016 17:16:04 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2814.html#p2814</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2810.html#p2810</link>
			<description><![CDATA[<p>I am somewhat newbie and do not know how to carry out the second solution. Regarding the first solution I think placed correctly references, this since I am able to make the call to &quot;wc_InitRng&quot;. I have included &quot;random.h&quot;, but the result is the same.</p><p>Can you be more specific about how to define my own &quot;CUSTOM_RAND_GENERATE_SEED&quot; with an example?</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Thu, 03 Nov 2016 13:34:44 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2810.html#p2810</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2808.html#p2808</link>
			<description><![CDATA[<p>Hi Jesussotofan,</p><p>Your platform must not have a random number seed function defined in random.c (starting at line 1133).</p><p>Either you can:<br />1. Locate a reference implementation in random.c and make sure you have the right define set for your hardware platform / OS.</p><p>2. Define CUSTOM_RAND_GENERATE_SEED and use your own implementation:</p><p>int rand_gen_seed(byte* output, word32 sz);<br />#define CUSTOM_RAND_GENERATE_SEED&nbsp; rand_gen_seed</p><p>In your example above, I also recommend:<br />including:<br />#include &lt;wolfssl/wolfcrypt/random.h&gt;</p><p>Using WC_RNG for the rng global:<br />WC_RNG rng;</p><p>Let me know if you have anymore questions,</p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Wed, 02 Nov 2016 17:50:22 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2808.html#p2808</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] using rsa, "undefined reference to `wc_GenerateSeed'" error]]></title>
			<link>https://www.wolfssl.com/forums/post2807.html#p2807</link>
			<description><![CDATA[<p>Hi, I&#039;m trying to test RSA encryption arduino.<br />Libs have imported correctly, but when I try to run the example I get the error: </p><p>&quot;C: \ Users \ Eugenio \ AppData \ Local \ Temp \ ccDlIFnm.ltrans0.ltrans.o: In function` loop &#039;:</p><p>: ( ccDlIFnm.ltrans0.o text + 0xc6c.): undefined reference to `wc_GenerateSeed &#039;</p><p>collect2.exe: error: ld returned 1 exit status&quot;</p><p>This is my code:</p><div class="codebox"><pre><code>#include &lt;wolfssl.h&gt;
#include &lt;wolfssl/wolfcrypt/rsa.h&gt;

void setup(void){

  while(!Serial);
  Serial.begin(9600);
}
 
void loop(void){

RsaKey rsaPublicKey;
byte publicKeyBuffer[]  = {&quot;MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL+pEyWGAfj8NRW03Ox55IXMCLwCm1EjQ0mwonOjazvAkkwLSthUPmaCq2/A01843K3zqN40dslDUwYlfAg9hC8CAwEAAQ==&quot;}; // holds the raw data from the key, maybe from a file like RsaPublicKey.der 
word32 idx = 0;             //  where to start reading into the buffer
byte in[] = {&quot;hola mundohola mundohola mundoho&quot;};
byte out[128];
RNG rng;
wc_InitRng(&amp;rng);


wc_RsaPublicKeyDecode(publicKeyBuffer, &amp;idx, &amp;rsaPublicKey, sizeof(publicKeyBuffer));
word32 outLen = wc_RsaPublicEncrypt(in, sizeof(in), out, sizeof(out), &amp;rsaPublicKey, &amp;rng);

delay(3000);
}</code></pre></div><p>Can you give me a hand?</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Wed, 02 Nov 2016 11:44:35 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2807.html#p2807</guid>
		</item>
	</channel>
</rss>
