algorithms.c (hLATIN_prf): Allow all supported sizes of key.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 13 Oct 2019 23:59:30 +0000 (00:59 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 22 Nov 2019 22:18:12 +0000 (22:18 +0000)
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);                                   \