<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95461/nrf_crypto_allocator-h</link><description>Hi, I have no &amp;quot;nrf_crypto_allocator.h&amp;quot; in Components. Can anyone help me where to find this file?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Jan 2023 06:25:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95461/nrf_crypto_allocator-h" /><item><title>RE: nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/thread/405945?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 06:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9da0258c-768a-474c-87c4-afce6138db84</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi, sure&lt;/p&gt;
&lt;p&gt;The cryptographic functions need some memory to operate with. This memory can be &amp;quot;allocated&amp;quot; to the crypto functions in various ways - statically to the stack, or dynamically, to heap memory. This is not specific to Nordic chips, you could read more about it here: &lt;a href="https://www.geeksforgeeks.org/difference-between-static-and-dynamic-memory-allocation-in-c/"&gt;https://www.geeksforgeeks.org/difference-between-static-and-dynamic-memory-allocation-in-c/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Dynamic (heap) memory allocation uses some algorithm to find free memory and reserve it for your function. For some advanced users, it might be desirable to use a custom algorithm or mechanism to allocate memory. For those users, NRF_CRYPTO_ALLOCATOR can be set to &lt;code&gt;1 (User Macros)&lt;/code&gt;. If this option is selected, the user has to provide their own functions for allocating memory, declared through &lt;code&gt;nrf_crypto_allocator.h&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But, as stated by my colleague in a similar case, option 1 (and therefore the header file) is usually not needed:&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82179/nrf_crypto_allocator-h-no-such-file-or-directory"&gt;/nrf_crypto_allocator.h: No such file or directory&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Please try settin&lt;code&gt;g NRF_CRYPTO_ALLOCATOR&lt;/code&gt; to 0, to use the default allocator.&lt;/p&gt;
&lt;p&gt;Or, if your previous colleague really found need to use a custom allocator, you will have to find out why they made this decision, and if it&amp;#39;s still relevant, you should implement the functions &lt;code&gt;NRF_CRYPTO_ALLOC&lt;/code&gt;, &lt;code&gt;NRF_CRYPTO_FREE&lt;/code&gt;, and &lt;code&gt;NRF_CRYPTO_ALLOC_ON_STACK&lt;/code&gt; according to that need.&lt;/p&gt;
&lt;p&gt;I hope this clarifies things.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/thread/404906?ContentTypeID=1</link><pubDate>Sun, 15 Jan 2023 17:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7832a75e-a2f7-4353-83c5-1df42dba80e8</guid><dc:creator>raza22</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;br /&gt;&lt;br /&gt;can you elaborate more, because i am looking at the code of my precious college and i am new to nordic chips. it would be a great help. thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/thread/403742?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 08:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:363bd487-e252-44be-a569-50016bf764f6</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;That&amp;#39;s correct, that option is there specifically for you to add your own &amp;quot;user&amp;quot; allocator functions. The other options are detailed in the documentation page I linked you.&lt;/p&gt;
&lt;p&gt;Just look for the Macro Definition Documentation for &lt;code&gt;#define NRF_CRYPTO_ALLOCATOR&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;There are options to allocate to stack memory, to heap memory with &lt;code&gt;malloc&lt;/code&gt;, or to use &lt;code&gt;nrf_malloc&lt;/code&gt; to let it be handled by the SDK Memory Manager&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/thread/403735?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 08:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a72b89e-1e5a-4a61-a4a4-b6e2b332b1ea</guid><dc:creator>raza22</dc:creator><description>&lt;p&gt;HI Raaul,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks alot for your reply.&amp;nbsp;&lt;br /&gt;so there is no header in SDK that declares those functions? and what other option can i use for this that uses already present headers in the SDK.&lt;br /&gt;&lt;br /&gt;Best,&lt;br /&gt;Raza Abbas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_crypto_allocator.h</title><link>https://devzone.nordicsemi.com/thread/403711?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 06:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:655460ec-0c81-450c-94f2-3a8bd01c4e74</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Raza,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m no expert on this matter, but based on the information I found in this page: &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.0%2Fgroup__nrf__crypto__config.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.0%2Fgroup__nrf__crypto__config.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It seems that you might have set&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#define NRF_CRYPTO_ALLOCATOR&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;&lt;code&gt;1 (User macros)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;According to the description, this requires you to add your own header file that declares the functions &lt;code&gt;NRF_CRYPTO_ALLOC&lt;/code&gt;, &lt;code&gt;NRF_CRYPTO_FREE&lt;/code&gt;, and &lt;code&gt;NRF_CRYPTO_ALLOC_ON_STACK&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So you&amp;#39;ll have to either do that, or choose another option for &lt;code&gt;NRF_CRYPTO_ALLOCATOR&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul Pathak&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>