Index: new_tests/OFScryptTests.m ================================================================== --- new_tests/OFScryptTests.m +++ new_tests/OFScryptTests.m @@ -103,20 +103,26 @@ 0xDF, 0xDF, 0xFA, 0x3F, 0xED, 0xE2, 0x14, 0x42, 0xFC, 0xD0, 0x06, 0x9D, 0xED, 0x09, 0x48, 0xF8, 0x32, 0x6A, 0x75, 0x3A, 0x0F, 0xC8, 0x1F, 0x17, 0xE8, 0xD3, 0xE0, 0xFB, 0x2E, 0x0D, 0x36, 0x28, 0xCF, 0x35, 0xE2, 0x0C, 0x38, 0xD1, 0x89, 0x06 }; +/* Nintendo DS does not have enough RAM for the second test vector. */ +#ifndef OF_NINTENDO_DS static const unsigned char testVector2[64] = { 0xFD, 0xBA, 0xBE, 0x1C, 0x9D, 0x34, 0x72, 0x00, 0x78, 0x56, 0xE7, 0x19, 0x0D, 0x01, 0xE9, 0xFE, 0x7C, 0x6A, 0xD7, 0xCB, 0xC8, 0x23, 0x78, 0x30, 0xE7, 0x73, 0x76, 0x63, 0x4B, 0x37, 0x31, 0x62, 0x2E, 0xAF, 0x30, 0xD9, 0x2E, 0x22, 0xA3, 0x88, 0x6F, 0xF1, 0x09, 0x27, 0x9D, 0x98, 0x30, 0xDA, 0xC7, 0x27, 0xAF, 0xB9, 0x4A, 0x83, 0xEE, 0x6D, 0x83, 0x60, 0xCB, 0xDF, 0xA2, 0xCC, 0x06, 0x40 }; -/* The third test vector is too expensive for m68k. */ -#ifndef OF_M68K +#endif +/* + * The third test vector is too expensive for m68k. + * Nintendo DS does not have enough RAM for the third test vector. + */ +#if !defined(OF_M68K) && !defined(OF_NINTENDO_DS) static const unsigned char testVector3[64] = { 0x70, 0x23, 0xBD, 0xCB, 0x3A, 0xFD, 0x73, 0x48, 0x46, 0x1C, 0x06, 0xCD, 0x81, 0xFD, 0x38, 0xEB, 0xFD, 0xA8, 0xFB, 0xBA, 0x90, 0x4F, 0x8E, 0x3E, 0xA9, 0xB5, 0x43, 0xF6, 0x54, 0x5D, 0xA1, 0xF2, 0xD5, 0x43, 0x29, 0x55, 0x61, 0x3F, 0x0F, 0xCF, 0x62, 0xD4, 0x97, 0x05, 0x24, 0x2A, 0x9A, 0xF9, @@ -181,10 +187,12 @@ }); OTAssertEqual(memcmp(output, testVector1, 64), 0); } +/* Nintendo DS does not have enough RAM for the second test vector. */ +#ifndef OF_NINTENDO_DS - (void)testRFC7941TestVector2 { unsigned char output[64]; OFScrypt((OFScryptParameters){ @@ -200,13 +208,17 @@ .allowsSwappableMemory = true }); OTAssertEqual(memcmp(output, testVector2, 64), 0); } +#endif -/* The third test vector is too expensive for m68k. */ -#ifndef OF_M68K +/* + * The third test vector is too expensive for m68k. + * Nintendo DS does not have enough RAM for the third test vector. + */ +#if !defined(OF_M68K) && !defined(OF_NINTENDO_DS) - (void)testRFC7941TestVector3 { unsigned char output[64]; OFScrypt((OFScryptParameters){ ADDED new_tests/testfile.txt Index: new_tests/testfile.txt ================================================================== --- new_tests/testfile.txt +++ new_tests/testfile.txt @@ -0,0 +1,1 @@ +testäöü Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -428,11 +428,11 @@ return OFMaxRetainCount; } - (bool)hasTerminal { -#if defined(OF_WII) || defined(OF_NINTENDO_3DS) +#if defined(OF_WII) || defined(OF_NINTENDO_DS) || defined(OF_NINTENDO_3DS) return true; #elif defined(HAVE_ISATTY) && !defined(OF_WII_U) return isatty(_fd); #else return false; Index: src/OFString+PathAdditions.m ================================================================== --- src/OFString+PathAdditions.m +++ src/OFString+PathAdditions.m @@ -19,11 +19,11 @@ #if defined(OF_WINDOWS) || defined(OF_MSDOS) || defined(OF_MINT) # import "platform/Windows/OFString+PathAdditions.m" #elif defined(OF_AMIGAOS) # import "platform/AmigaOS/OFString+PathAdditions.m" -#elif defined(OF_NINTENDO_3DS) || defined(OF_WII) || \ - defined(OF_NINTENDO_SWITCH) +#elif defined(OF_WII) || defined(OF_NINTENDO_DS) || \ + defined(OF_NINTENDO_3DS) || defined(OF_NINTENDO_SWITCH) # import "platform/libfat/OFString+PathAdditions.m" #else # import "platform/POSIX/OFString+PathAdditions.m" #endif Index: src/test/OTAppDelegate.m ================================================================== --- src/test/OTAppDelegate.m +++ src/test/OTAppDelegate.m @@ -32,10 +32,16 @@ # define asm __asm__ # include # include # undef asm #endif + +#ifdef OF_NINTENDO_DS +# define asm __asm__ +# include +# undef asm +#endif #ifdef OF_NINTENDO_3DS /* Newer versions of libctru started using id as a parameter name. */ # define id id_3ds # include <3ds.h> @@ -88,10 +94,12 @@ if (mode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); CON_InitEx(mode, 2, 2, mode->fbWidth - 4, mode->xfbHeight - 4); VIDEO_ClearFrameBuffer(mode, nextFB, COLOR_BLACK); +#elif defined(OF_NINTENDO_DS) + consoleDemoInit(); #elif defined(OF_NINTENDO_3DS) gfxInitDefault(); atexit(gfxExit); consoleInit(GFX_TOP, NULL); @@ -235,10 +243,21 @@ if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) break; VIDEO_WaitVSync(); + } +#elif defined(OF_NINTENDO_DS) + [OFStdOut setForegroundColor: [OFColor silver]]; + [OFStdOut writeLine: @"Press A to continue"]; + + for (;;) { + swiWaitForVBlank(); + scanKeys(); + + if (keysDown() & KEY_A) + break; } #elif defined(OF_NINTENDO_3DS) [OFStdOut setForegroundColor: [OFColor silver]]; [OFStdOut writeLine: @"Press A to continue"]; @@ -474,10 +493,21 @@ if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break; VIDEO_WaitVSync(); + } +#elif defined(OF_NINTENDO_DS) + [OFStdOut setForegroundColor: [OFColor silver]]; + [OFStdOut writeLine: @"Press start button to exit"]; + + for (;;) { + swiWaitForVBlank(); + scanKeys(); + + if (keysDown() & KEY_START) + break; } #elif defined(OF_NINTENDO_3DS) [OFStdOut setForegroundColor: [OFColor silver]]; [OFStdOut writeLine: @"Press start button to exit"];