]> pd.if.org Git - zpackage/blobdiff - crypto/libeddsa/lib/burnstack.c
add package signing code
[zpackage] / crypto / libeddsa / lib / burnstack.c
diff --git a/crypto/libeddsa/lib/burnstack.c b/crypto/libeddsa/lib/burnstack.c
new file mode 100644 (file)
index 0000000..acc140e
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdint.h>
+
+#include "burn.h"
+#include "burnstack.h"
+
+
+#ifdef USE_STACKCLEAN
+
+/*
+ * burnstack - cleanup our stack
+ */
+void
+burnstack(int len)
+{
+       uint8_t stack[1024];
+       burn(stack, 1024);
+       if (len > 0)
+               burnstack(len-1024);
+}
+
+#endif