<?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 — AesCbcDecrypt hardfaulting on STmicro]]></title>
		<link>https://www.wolfssl.com/forums/topic765-aescbcdecrypt-hardfaulting-on-stmicro.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic765.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in AesCbcDecrypt hardfaulting on STmicro.]]></description>
		<lastBuildDate>Fri, 29 Jan 2016 21:00:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AesCbcDecrypt hardfaulting on STmicro]]></title>
			<link>https://www.wolfssl.com/forums/post2397.html#p2397</link>
			<description><![CDATA[<p>Hi lwatcdr,</p><p>There is a couple things to check with the code. The first thing to check for the issue with hard faulting is that &quot;size&quot; is a pointer since being dereferenced and to check &quot;size&quot; is not NULL.</p><p>wc_AesCbcDecrypt(&amp;denc,block,cipher,*size);</p><p>The next thing to check is that the return value of wc_AesSetKey is equal to 0. If it is not then there is a case where denc has not been set.</p><p>The final thing with the hard fault is to make sure that AESSIZE is equal to AES_BLOCK_SIZE from wolfSSL.</p><p>Not related to a hard fault but still important is that the iv should be the same as what was used for encryption. Creating a new random iv for the decryption will result in not being able to properly decrypt the information.</p><p>An example of using AES can be found at <a href="https://github.com/wolfSSL/wolfssl-examples/tree/master/crypto/aes">https://github.com/wolfSSL/wolfssl-exam … crypto/aes</a> though it has a little bit more since using the function wc_PBKDF2 to stretch out the key if needed, it allows for seeing the flow of a standard AES encrypt -&gt; decrypt.</p><p>Regards,<br />Jacob</p>]]></description>
			<author><![CDATA[null@example.com (Jacob)]]></author>
			<pubDate>Fri, 29 Jan 2016 21:00:52 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2397.html#p2397</guid>
		</item>
		<item>
			<title><![CDATA[AesCbcDecrypt hardfaulting on STmicro]]></title>
			<link>https://www.wolfssl.com/forums/post2394.html#p2394</link>
			<description><![CDATA[<p>I am trying to get Aes to work and I am having an issue with it hard faulting.</p><p>I call this to generate the key</p><p>ret = wc_RNG_GenerateBlock(&amp;sysRNG,iv,AESSIZE);<br />ret=wc_AesSetKey(&amp;denc,aesKey,AESSIZE,iv,AES_DECRYPTION);</p><p>And then call this to decrypt each packet as it comes in.</p><p>wc_AesCbcDecrypt(&amp;denc,block,cipher,*size);</p><p>and this is my settings.h file<br />#ifdef WOLFSSL_STM32F2<br />&nbsp; &nbsp; #define SIZEOF_LONG_LONG 8<br />&nbsp; &nbsp; #define NO_DEV_RANDOM<br />&nbsp; &nbsp; #define NO_WOLFSSL_DIR<br />&nbsp; &nbsp; #define NO_RABBIT<br />&nbsp; &nbsp; #define STM32F2_RNG<br />&nbsp; &nbsp; #define STM32F2_CRYPTO<br />&nbsp; &nbsp; #define KEIL_INTRINSICS<br />&nbsp; &nbsp; #define NO_WRITEV<br />&nbsp; &nbsp; #define NO_FILESYSTEM<br />&nbsp; &nbsp; #define NO_DES3<br />&nbsp; &nbsp; #undef&nbsp; NO_AES<br />&nbsp; &nbsp; #define SINGLE_THREADED<br />&nbsp; &nbsp; #define WOLFSSL_KEY_GEN<br />&nbsp; &nbsp; #define RSA_DECODE_EXTRA<br />#endif</p><p>Any ideas I am using an STM32F4 but the crypto block is supposed to be compatible</p>]]></description>
			<author><![CDATA[null@example.com (lwatcdr)]]></author>
			<pubDate>Fri, 29 Jan 2016 15:44:20 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2394.html#p2394</guid>
		</item>
	</channel>
</rss>
