aboutsummaryrefslogtreecommitdiff
path: root/src/ext/keccak-tiny/keccak-tiny-unrolled.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-12-18 22:18:00 +0000
committerYawning Angel <yawning@schwanenlied.me>2015-12-19 22:34:39 +0000
commit5356eba6ca31c881032c028f4797a0b1ede28bae (patch)
tree15681daab03c3c665c08911ce190f1f758ee837f /src/ext/keccak-tiny/keccak-tiny-unrolled.c
parent18685df031b4d5c0f1f0b20394d3d7f64d155cb4 (diff)
downloadtor-5356eba6ca31c881032c028f4797a0b1ede28bae.tar.gz
tor-5356eba6ca31c881032c028f4797a0b1ede28bae.zip
Use tor specific headers and memwipe() instead of memset_s(), and build.
This is where things get tor specific. It's just replacing stdint.h and memset_s with the tor compat code so going back is trivial...
Diffstat (limited to 'src/ext/keccak-tiny/keccak-tiny-unrolled.c')
-rw-r--r--src/ext/keccak-tiny/keccak-tiny-unrolled.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ext/keccak-tiny/keccak-tiny-unrolled.c b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
index 9ad818603c..4b4f51c7cf 100644
--- a/src/ext/keccak-tiny/keccak-tiny-unrolled.c
+++ b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
@@ -8,10 +8,8 @@
*/
#include "keccak-tiny.h"
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
+#include "crypto.h"
/******** The Keccak-f[1600] permutation ********/
@@ -168,7 +166,7 @@ keccak_finalize(keccak_state *s)
// Xor in the last block.
xorin(s->a, s->block, s->offset);
- memset_s(s->block, sizeof(s->block), 0, sizeof(s->block));
+ memwipe(s->block, 0, sizeof(s->block));
s->finalized = 1;
s->offset = s->rate;
}
@@ -310,7 +308,7 @@ keccak_clone(keccak_state *out, const keccak_state *in)
void
keccak_cleanse(keccak_state *s)
{
- memset_s(s, sizeof(keccak_state), 0, sizeof(keccak_state));
+ memwipe(s, 0, sizeof(keccak_state));
}
/** The sponge-based hash construction. **/