From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: bytestring.c, catacomb/__init__.py: Compare for equality in constant time. X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/commitdiff_plain/54ecf9dd37fb6fac413c9545b2788edb54e20bff bytestring.c, catacomb/__init__.py: Compare for equality in constant time. There's an explicit `ctstreq' function which just does what you wanted. Also, `ByteString' objects now have a rich-compare method which always compares for equality in constant time. Ordering comparisons are variable time still. There's a little chicanery to retain the hash function from `str'. Also add a simple `check' method to `GHash' and `Poly1305Hash' which compares a hsah or MAC tag in constant time and returns a boolean result. --- diff --git a/catacomb-python.h b/catacomb-python.h index 77c7eae..f1e6365 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -46,6 +46,7 @@ #include #include +#include #include #include