Add support for (DevkitPro)libnds
This commit is contained in:
parent
1c8f1e6921
commit
337456cc1e
1
.gitignore
vendored
1
.gitignore
vendored
@ -245,6 +245,7 @@ linuxkm/libwolfssl.mod.c
|
||||
linuxkm/libwolfssl.lds
|
||||
linuxkm/module_exports.c
|
||||
linuxkm/linuxkm/get_thread_size
|
||||
*.nds
|
||||
|
||||
# autotools generated
|
||||
scripts/unit.test
|
||||
|
@ -49,6 +49,7 @@ Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7702
|
||||
* Support for NIST 800-56C Option 1 KDF, using the macro WC_KDF_NIST_SP_800_56C added (PR 7589)
|
||||
* AES-XTS streaming mode added, along with hardware acceleration and kernel module use (PR 7522, 7560, 7424)
|
||||
* PlatformIO FreeRTOS with ESP build and addition of benchmark and test example applications (PR 7528, 7413, 7559, 7542)
|
||||
* Add support for (DevkitPro)libnds
|
||||
|
||||
|
||||
## Enhancements and Optimizations
|
||||
|
36
IDE/NDS/README.md
Normal file
36
IDE/NDS/README.md
Normal file
@ -0,0 +1,36 @@
|
||||
# wolfSSL for libnds
|
||||
|
||||
## Requirements
|
||||
|
||||
[Devkitpro](https://devkitpro.org/wiki/Getting_Started) with libnds.
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
```
|
||||
$ ./configure \
|
||||
--host=arm-none-eabi \
|
||||
CC=$DEVKITARM/bin/arm-none-eabi-g++ \
|
||||
AR=$DEVKITARM/bin/arm-none-eabi-ar \
|
||||
STRIP=$DEVKITARM/bin/arm-none-eabi-strip \
|
||||
RANLIB=$DEVKITARM/bin/arm-none-eabi-ranlib \
|
||||
LIBS="-lfat -lnds9" \
|
||||
LDFLAGS="-L/opt/devkitpro/libnds/lib" \
|
||||
--prefix=$DEVKITPRO/portlibs/nds \
|
||||
CFLAGS="-march=armv5te -mtune=arm946e-s \
|
||||
--specs=ds_arm9.specs -DARM9 -DNDS \
|
||||
-DWOLFSSL_USER_IO \
|
||||
-I$DEVKITPRO/libnds/include" \
|
||||
--enable-fastmath --disable-benchmark \
|
||||
--disable-shared --disable-examples --disable-ecc
|
||||
$ make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
## Run the Tests
|
||||
|
||||
To run the Crypttests type the following.
|
||||
1. Run `$ ndstool -9 ./wolfcrypt/test/testwolfcrypt -c ./wolfcrypt/test/testwolfcrypt.nds`
|
||||
2. copy `./certs` to `your_nds_sd_card/_nds/certs`
|
||||
|
||||
3. Run the Rom (located in ./wolfcrypt/test/testwolfcrypt.nds) in an Emulator or real Hardware.
|
1
README
1
README
@ -121,6 +121,7 @@ Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7702
|
||||
* Support for NIST 800-56C Option 1 KDF, using the macro WC_KDF_NIST_SP_800_56C added (PR 7589)
|
||||
* AES-XTS streaming mode added, along with hardware acceleration and kernel module use (PR 7522, 7560, 7424)
|
||||
* PlatformIO FreeRTOS with ESP build and addition of benchmark and test example applications (PR 7528, 7413, 7559, 7542)
|
||||
* Add support for (DevkitPro)libnds
|
||||
|
||||
|
||||
## Enhancements and Optimizations
|
||||
|
@ -126,6 +126,7 @@ Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7702
|
||||
* Support for NIST 800-56C Option 1 KDF, using the macro WC_KDF_NIST_SP_800_56C added (PR 7589)
|
||||
* AES-XTS streaming mode added, along with hardware acceleration and kernel module use (PR 7522, 7560, 7424)
|
||||
* PlatformIO FreeRTOS with ESP build and addition of benchmark and test example applications (PR 7528, 7413, 7559, 7542)
|
||||
* Add support for (DevkitPro)libnds
|
||||
|
||||
|
||||
## Enhancements and Optimizations
|
||||
|
@ -3815,7 +3815,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#elif defined(DOLPHIN_EMULATOR)
|
||||
#elif defined(DOLPHIN_EMULATOR) || defined (NDS)
|
||||
|
||||
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
|
@ -426,6 +426,13 @@ const byte const_byte_array[] = "A+Gd\0\0\0";
|
||||
#ifdef DEVKITPRO
|
||||
#include <wiiuse/wpad.h>
|
||||
#endif
|
||||
#ifdef NDS
|
||||
#include <nds/ndstypes.h>
|
||||
#include <nds/arm9/console.h>
|
||||
#include <nds/arm9/input.h>
|
||||
#include <nds/interrupts.h>
|
||||
#include <fat.h>
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_HAVE_ECC_KEY_GET_PRIV
|
||||
/* FIPS build has replaced ecc.h. */
|
||||
@ -2457,6 +2464,13 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
|
||||
VIDEO_WaitVSync();
|
||||
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
|
||||
#endif
|
||||
#ifdef NDS
|
||||
// Init Console output
|
||||
consoleDemoInit();
|
||||
|
||||
// Init the Filesystem
|
||||
fatInitDefault();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WNR
|
||||
if ((ret = wc_InitNetRandom(wnrConfigFile, NULL, 5000)) != 0) {
|
||||
@ -2502,6 +2516,18 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
|
||||
while (1);
|
||||
#endif
|
||||
|
||||
#ifdef NDS
|
||||
// in Nintendo DS returning from main shuts down the Device without letting you see the Results.
|
||||
printf("args.return_code: %d\n", args.return_code);
|
||||
printf("Testing complete. Press Start to exit the Program\n");
|
||||
while(1) {
|
||||
swiWaitForVBlank();
|
||||
scanKeys();
|
||||
int keys = keysDown();
|
||||
if(keys & KEY_START) break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_ESPIDF)
|
||||
/* ESP_LOGI to print takes up a lot less memory than printf */
|
||||
ESP_LOGI(ESPIDF_TAG, "Exiting main with return code: % d\n",
|
||||
@ -17955,6 +17981,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memory_test(void)
|
||||
#elif defined(_WIN32_WCE)
|
||||
#define CERT_PREFIX "\\windows\\"
|
||||
#define CERT_PATH_SEP "\\"
|
||||
#elif defined(NDS)
|
||||
#undef CERT_PREFIX
|
||||
#define CERT_PREFIX "fat:/_nds/"
|
||||
#define CERT_PATH_SEP "/"
|
||||
#endif
|
||||
|
||||
#ifndef CERT_PREFIX
|
||||
|
@ -3127,7 +3127,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
!defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \
|
||||
!defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) && \
|
||||
!defined(WOLFSSL_CHIBIOS) && !defined(WOLFSSL_CONTIKI) && \
|
||||
!defined(WOLFSSL_ZEPHYR) && !defined(NETOS)
|
||||
!defined(WOLFSSL_ZEPHYR) && !defined(NETOS) && !defined(NDS)
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
/* allow writev style writing */
|
||||
|
@ -203,7 +203,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/ioctl.h>
|
||||
#ifndef NDS
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#ifdef HAVE_PTHREAD
|
||||
|
@ -262,6 +262,9 @@
|
||||
/* Uncomment next line if building for Dolphin Emulator */
|
||||
/* #define DOLPHIN_EMULATOR */
|
||||
|
||||
/* Uncomment next line if building for NDS */
|
||||
/* #define NDS */
|
||||
|
||||
/* Uncomment next line if using MAXQ1065 */
|
||||
/* #define WOLFSSL_MAXQ1065 */
|
||||
|
||||
@ -469,6 +472,23 @@
|
||||
#include <nx_api.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NDS
|
||||
#include <stddef.h>
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define socklen_t int
|
||||
#define IPPROTO_UDP 17
|
||||
#define IPPROTO_TCP 6
|
||||
|
||||
/* Libnds doesn't include sys/uio.h. */
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base; /* Pointer to data. */
|
||||
size_t iov_len; /* Length of data. */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO)
|
||||
#if defined(ESP32)
|
||||
#ifndef NO_ARDUINO_DEFAULT
|
||||
|
Loading…
Reference in New Issue
Block a user