aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-06-12 22:39:53 -0400
committerFranklin Wei <me@fwei.tk>2018-06-12 22:39:53 -0400
commit96f1240471dd75638f2a53b769a4a63e5e083b7e (patch)
tree5aefcfaaf3596033dfca8df745ce4fabab823748 /crypto.c
parentcae99b638f54748e52a10ca613c1758c9646e2d0 (diff)
downloadcsaa-96f1240471dd75638f2a53b769a4a63e5e083b7e.zip
csaa-96f1240471dd75638f2a53b769a4a63e5e083b7e.tar.gz
csaa-96f1240471dd75638f2a53b769a4a63e5e083b7e.tar.bz2
csaa-96f1240471dd75638f2a53b769a4a63e5e083b7e.tar.xz
Various changes; also implement binary tree complement calculation
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto.c b/crypto.c
index 6039b7f..da4ef61 100644
--- a/crypto.c
+++ b/crypto.c
@@ -59,6 +59,12 @@ hash_t hash_xor(hash_t a, hash_t b)
return a;
}
+void hash_zero(hash_t *h)
+{
+ for(int i = 0; i < 32; ++i)
+ h->hash[i] = 0;
+}
+
/* NOTE: we fail to distinguish between intermediate and leaf
* nodes, making a second-preimage attack possible */
/* order: 0: u is left, v is right, 1: u is right, v is left */