From 8fc76cc0e1dea41218fca11b3405183252e7f57f Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 17 Nov 2019 23:23:41 +0000 Subject: [PATCH] catacomb/__init__.py (KeySZRange.pad): Return correct value. If the input is already a multiple of the modulus, then don't round up to the next one. --- catacomb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catacomb/__init__.py b/catacomb/__init__.py index 9178475..65695bb 100644 --- a/catacomb/__init__.py +++ b/catacomb/__init__.py @@ -623,7 +623,7 @@ class _tmp: def pad(me, sz): if sz > me.max: raise ValueError, 'key too large' elif sz < me.min: return me.min - else: sz += me.mod; return sz - sz%me.mod + else: sz += me.mod - 1; return sz - sz%me.mod _augment(KeySZRange, _tmp) class _tmp: -- 2.11.0