Updated the Rowley Crossworks example so it builds due to new user-crypto. Tested and verified new "CUSTOM_RAND_TYPE" using 8, 16 and 32 bit values.

pull/177/head
David Garske 2015-11-06 09:41:16 -08:00
parent 05f4c83b98
commit 099b6bc3df
4 changed files with 17 additions and 9 deletions

View File

@ -10,4 +10,4 @@ uint32_t hw_get_time_sec(void);
uint32_t hw_get_time_msec(void); uint32_t hw_get_time_msec(void);
void hw_uart_printchar(int c); void hw_uart_printchar(int c);
void hw_watchdog_disable(void); void hw_watchdog_disable(void);
int hw_rand(void); uint32_t hw_rand(void);

View File

@ -167,7 +167,7 @@ void hw_uart_printchar(int c)
UART_PORT->D = (uint8_t)c; /* Send the character */ UART_PORT->D = (uint8_t)c; /* Send the character */
} }
int hw_rand(void) uint32_t hw_rand(void)
{ {
while((RNG->SR & RNG_SR_OREG_LVL(0xF)) == 0) {}; /* Wait until FIFO has a value available */ while((RNG->SR & RNG_SR_OREG_LVL(0xF)) == 0) {}; /* Wait until FIFO has a value available */
return RNG->OR; /* Return next value in FIFO output register */ return RNG->OR; /* Return next value in FIFO output register */

View File

@ -29,7 +29,7 @@ double current_time(int reset)
return time; return time;
} }
int custom_rand_generate(void) uint32_t custom_rand_generate(void)
{ {
return hw_rand(); return hw_rand();
} }

View File

@ -10,12 +10,14 @@
project_type="Library" /> project_type="Library" />
<folder Name="Source Files"> <folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;inc" /> <configuration Name="Common" filter="c;cpp;cxx;cc;h;s;inc" />
<folder <folder Name="wolfcrypt">
Name="wolfcrypt" <folder Name="benchmark" path="../../wolfcrypt/benchmark" />
exclude="*.asm;*.s" <folder Name="src" path="../../wolfcrypt/src" />
filter="" <folder Name="test" path="../../wolfcrypt/test" />
path="../../wolfcrypt" <folder Name="user-crypto" path="../../wolfcrypt/user-crypto">
recurse="Yes" /> <configuration Name="Common" build_exclude_from_build="Yes" />
</folder>
</folder>
<folder <folder
Name="wolfssl" Name="wolfssl"
exclude="*.asm;*.s" exclude="*.asm;*.s"
@ -24,6 +26,12 @@
recurse="Yes" /> recurse="Yes" />
<file file_name="user_settings.h" /> <file file_name="user_settings.h" />
<file file_name="README.md" /> <file file_name="README.md" />
<folder
Name="source"
exclude=""
filter=""
path="../../src"
recurse="No" />
</folder> </folder>
</project> </project>
<project Name="test"> <project Name="test">