From 0e5c668c75eb9f7bb4394bf69fe96c760308df58 Mon Sep 17 00:00:00 2001 Message-Id: <0e5c668c75eb9f7bb4394bf69fe96c760308df58.1714485419.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 9 Nov 2018 17:02:20 +0000 Subject: [PATCH] algorithms.c: Slightly simplify integer-hashing methods. Organization: Straylight/Edgeware From: Mark Wooding There's no need for these to have an `end' label. --- algorithms.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/algorithms.c b/algorithms.c index 3e1866f..033176b 100644 --- a/algorithms.c +++ b/algorithms.c @@ -788,11 +788,9 @@ static PyObject *ghmeth_hash(PyObject *me, PyObject *arg) static PyObject *ghmeth_hashu##w(PyObject *me, PyObject *arg) \ { \ uint##n x; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ GH_HASHU##W(GHASH_H(me), x); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(GHMETH_HASHU_) @@ -1308,11 +1306,9 @@ static PyObject *polymeth_hash(PyObject *me, PyObject *arg) { \ uint##n x; \ octet b[SZ_##W]; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ STORE##W(b, x); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(POLYMETH_HASHU_) @@ -1807,12 +1803,10 @@ static PyObject *shakemeth_hash(PyObject *me, PyObject *arg) { \ uint##n x; \ octet b[SZ_##W]; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ - if (shake_check(me, 0)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ + if (shake_check(me, 0)) return (0); \ STORE##W(b, x); shake_hash(SHAKE_H(me), b, sizeof(b)); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(SHAKEMETH_HASHU_) -- [mdw]