<?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 — 'Not enought memory' Arduino]]></title>
		<link>https://www.wolfssl.com/forums/topic863-not-enought-memory-arduino.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic863.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in 'Not enought memory' Arduino.]]></description>
		<lastBuildDate>Mon, 17 Oct 2016 20:09:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: 'Not enought memory' Arduino]]></title>
			<link>https://www.wolfssl.com/forums/post2756.html#p2756</link>
			<description><![CDATA[<p>Hi jesussotofan,</p><p>Could you tell me which board you are working with and what your available RAM and FLASH is?</p><p>For the AES algorithm to work unfortunately requires very large static tables (10280 bytes of RO or 10k). These can be viewed in &lt;wolfssl-root&gt;/wolfcrypt/src/aes.c under the define NEED_AES_TABLES. The only to get around using the tables in software is to have an AES hardware module on the board you&#039;re working with. It is very likely your board does not have that feature but it would not hurt to check.</p><p>If you do not have a hardware AES module and the tables will not fit into the available memory space... since this is a research project and you&#039;re probably not extremely concerned with bit-strength of the algorithm chosen... might I suggest instead using one of the following ciphers as alternates to AES:</p><div class="codebox"><pre><code>wc_AesSetKey             [4338 bytes code size | 10280 bytes RO data] Very Big footprint

Non-Stream cipher:
wc_Des3_SetKey           [1560 bytes code size | 2200 bytes RO data]  Medium footprint

Stream ciphers:

wc_Chacha_SetKey         [1160 bytes code size | 32 bytes RO data  ] smaller footprint
wc_Arc4SetKey            [184  bytes code size | 0 bytes RO data   ] tiny footprint</code></pre></div><p>All of these work fine on the Intel Gallileo, however if you platform is truely limited to 2k RAM as your error would indicate you will have to go with a much smaller algorithm.</p><br /><p>Kind Regards,</p><p>Kaleb (AKA kalsheraut on pi forums)</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Mon, 17 Oct 2016 20:09:00 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2756.html#p2756</guid>
		</item>
		<item>
			<title><![CDATA['Not enought memory' Arduino]]></title>
			<link>https://www.wolfssl.com/forums/post2750.html#p2750</link>
			<description><![CDATA[<p>Hi, I&#039;m doing an example exercise for encryption and decryption in Arduino.</p><div class="codebox"><pre><code>#include &lt;wolfssl.h&gt;
#include &lt;wolfssl/wolfcrypt/aes.h&gt;

 
void setup(void){

}
 
void loop(void){


Aes enc;

int ret = 0;

byte key[] = {&quot;0123456789abcdef&quot;};

byte iv[]  = {&quot;1234567890abcdef&quot;};

String plain = &quot;hola mundo&quot;;


if (ret = wc_AesSetKey(&amp;enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION) != 0) {

// failed to set aes key

}

}</code></pre></div><p>The trouble is the call to the function &#039;wc_AesSetKey&#039; produces a &#039;not enought memory&#039; arduino error.</p><p>If I comment function, it gets the message: &quot;Global variables use 35 bytes (1%) of dynamic memory, leaving 2,013 bytes for Local variables Maximum is 2,048 bytes..&quot;</p><p>But if the code is complete, I get: &quot;Global variables use 2,137 bytes (<strong>104%</strong>) of dynamic memory, leaving -89 Maximum bytes for the local variables is 2,048 bytes..<br /><strong>processing.app.debug.RunnerException: Not enough memory;</strong> <a href="http://www.arduino.cc/en/Guide/Troubleshooting#size">http://www.arduino.cc/en/Guide/Troubleshooting#size</a> see for tips on Reducing your footprint.<br />at cc.arduino.Compiler.size (Compiler.java:338)<br />at cc.arduino.Compiler.build (Compiler.java:158)<br />at processing.app.Sketch.build (Sketch.java:1111)<br />at processing.app.Sketch.exportApplet (Sketch.java:1146)<br />at processing.app.Sketch.exportApplet (Sketch.java:1132)<br />processing.app.Editor at $ DefaultExportHandler.run (Editor.java:2409)<br />at java.lang.Thread.run (Thread.java:745)<br />Not enough memory; <a href="http://www.arduino.cc/en/Guide/Troubleshooting#size">http://www.arduino.cc/en/Guide/Troubleshooting#size</a> see for tips on Reducing your footprint. &quot;</p><p>Any suggestion for fix it? Thanks for your replies in advance.</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Fri, 14 Oct 2016 12:03:17 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2750.html#p2750</guid>
		</item>
	</channel>
</rss>
