The unified diff between revisions [a1c3f430..] and [7122128a..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'demos/test/test.h'
#
#
# patch "demos/test/test.h"
# from [ca8227f354a804ca3d084fae803b0993c37dbf5d]
# to [c22340bc31baf6c414a8980466c0ccb7db089a17]
#
============================================================
--- demos/test/test.h ca8227f354a804ca3d084fae803b0993c37dbf5d
+++ demos/test/test.h c22340bc31baf6c414a8980466c0ccb7db089a17
@@ -3,6 +3,12 @@
#include "mycrypt.h"
+/* enable stack testing */
+// #define STACK_TEST
+
+/* stack testing, define this if stack usage goes downwards [e.g. x86] */
+#define STACK_DOWN
+
typedef struct {
char *name, *prov, *req;
int (*entry)(void);
@@ -10,10 +16,14 @@ extern prng_state test_yarrow;
extern prng_state test_yarrow;
-void run_cmd(int res, int line, char *file, char *cmd);
-#define DO(x) run_cmd((x), __LINE__, __FILE__, #x)
+void stack_masker(void);
+void stack_check(void);
+extern unsigned long stack_cur;
+#define stack_chk(x) { stack_check(); if (stack_cur >= 1024) { fprintf(stderr, " Warning: Stack usage of %lu in %s, %s:%d\n", stack_cur, x, __FILE__, __LINE__); } }
+void run_cmd(int res, int line, char *file, char *cmd);
+#define DO(x) { stack_masker(); run_cmd((x), __LINE__, __FILE__, #x); stack_chk(#x); }
/* TESTS */
int cipher_hash_test(void);
@@ -25,5 +35,6 @@ int dh_tests(void);
int ecc_tests(void);
int dsa_test(void);
int dh_tests(void);
+int der_tests(void);
#endif