algorithms.c (hLATIN_prf): Allow all supported sizes of key.
[catacomb-python] / algorithms.c
index 3d79c03..dcfb22d 100644 (file)
@@ -1568,7 +1568,7 @@ static PyTypeObject poly1305hash_pytype_skel = {
     if (!PyArg_ParseTuple(arg, "s#s#:" #hdance "_prf",                 \
                          &k, &ksz, &n, &nsz))                          \
       goto end;                                                                \
-    if (ksz != DANCE##_KEYSZ) VALERR("bad key length");                        \
+    if (ksz != keysz(ksz, dance##_keysz)) VALERR("bad key length");    \
     if (nsz != HDANCE##_INSZ) VALERR("bad input length");              \
     rc = bytestring_pywrap(0, HSALSA20_OUTSZ);                         \
     dance##_init(&dance, k, ksz, 0);                                   \