From b75462e8d463580b325794ecf2369c4ae801b5bd Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 11 May 2017 10:42:15 +0100 Subject: [PATCH] Add support for SHA3 and related algorithms. This comes in three tranches. * There are the basic generic-interface algorithms for SHA3-*, SHAKE*, KMAC*, etc., which basically just turn up by themselves, and the RNGs based on SHAKE and KMAC which took a little more work. * There's a full implementation of the cSHAKE128 and cSHAKE256 XOFs as a new kind of object. * Based on this, there's a full KMAC implementation, with the fiddly bits in Python (but all the heavy lifting is done in C), with variable-length tag and everything. Other constructions, e.g., TupleHash, can easily be made in the same way. Annoyingly, KMAC can't just be made from SHAKE by multiple inheritance because Python gets confused about how it's supposed to construct the objects, and, in particular, which `__new__' methods are OK to use. It seems that the relevant code is trying to use the `HEAPTYPE' flag as a proxy for whether a type is implemented in C, which doesn't work for our classes. So there's a bunch of ugly delegation to do. --- catacomb-python.h | 1 + 1 file changed, 1 insertion(+) diff --git a/catacomb-python.h b/catacomb-python.h index 3b9d8f7..65f2ed1 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -70,6 +70,7 @@ #include #include #include +#include #include #include -- 2.11.0