X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/69e137681fb60aa4acc6d9fd5b56b7adeba0b625..bfb450ccb248489a622c7dcb51ed5e150eb8f3b6:/catacomb/__init__.py diff --git a/catacomb/__init__.py b/catacomb/__init__.py index 120ef11..6745bce 100644 --- a/catacomb/__init__.py +++ b/catacomb/__init__.py @@ -94,8 +94,19 @@ class _tmp: def __repr__(me): return 'bytes(%r)' % hex(me) _augment(ByteString, _tmp) +ByteString.__hash__ = str.__hash__ bytes = ByteString.fromhex +###-------------------------------------------------------------------------- +### Hashing. + +class _tmp: + def check(me, h): + hh = me.done() + return ctstreq(h, hh) +_augment(GHash, _tmp) +_augment(Poly1305Hash, _tmp) + ###-------------------------------------------------------------------------- ### Multiprecision integers and binary polynomials.