From 2a82a9154f9d6e0b5658c82cd346051017339a1e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jan 2016 08:28:32 +0000 Subject: libaxolotl - initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@16169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../src/curve25519/ed25519/additions/zeroize.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libs/libaxolotl/src/curve25519/ed25519/additions/zeroize.c (limited to 'libs/libaxolotl/src/curve25519/ed25519/additions/zeroize.c') diff --git a/libs/libaxolotl/src/curve25519/ed25519/additions/zeroize.c b/libs/libaxolotl/src/curve25519/ed25519/additions/zeroize.c new file mode 100644 index 0000000000..37c1f708bc --- /dev/null +++ b/libs/libaxolotl/src/curve25519/ed25519/additions/zeroize.c @@ -0,0 +1,17 @@ +#include "zeroize.h" + +void zeroize(unsigned char* b, size_t len) +{ + size_t count = 0; + unsigned long retval = 0; + volatile unsigned char *p = b; + + for (count = 0; count < len; count++) + p[count] = 0; +} + +void zeroize_stack() +{ + unsigned char m[ZEROIZE_STACK_SIZE]; + zeroize(m, sizeof m); +} -- cgit v1.2.3