]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Silence two warnings in blake2. key_length is between 0 and 64 (block size).
authorChristian Heimes <christian@python.org>
Wed, 7 Sep 2016 00:49:11 +0000 (02:49 +0200)
committerChristian Heimes <christian@python.org>
Wed, 7 Sep 2016 00:49:11 +0000 (02:49 +0200)
Modules/_blake2/blake2b_impl.c
Modules/_blake2/blake2s_impl.c

index 1c67744f75859812449103e2c1bfe313cdf21b6c..9c3d8f54d531b8a5cd692813754e4222c0468066 100644 (file)
@@ -208,7 +208,7 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
                 BLAKE2B_KEYBYTES);
             goto error;
         }
-        self->param.key_length = key->len;
+        self->param.key_length = (uint8_t)key->len;
     }
 
     /* Initialize hash state. */
index 8b38270ae83723656027390e3a2d23634d8584f6..53c22c2a9bdefe6dc757f99caee5b567c240769b 100644 (file)
@@ -208,7 +208,7 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
                 BLAKE2S_KEYBYTES);
             goto error;
         }
-        self->param.key_length = key->len;
+        self->param.key_length = (uint8_t)key->len;
     }
 
     /* Initialize hash state. */