X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/668b5f544d001cbc6ba94a6f94f7590e4c4b9473..941a348351e409096689d4126214026eb2745d69:/algorithms.c diff --git a/algorithms.c b/algorithms.c index 4c8158d..dcdcff6 100644 --- a/algorithms.c +++ b/algorithms.c @@ -1194,7 +1194,7 @@ DOUINTCONV(GAEAMETH_HASHU_) { \ struct bin in; octet b[SZ_##W]; \ if (!PyArg_ParseTuple(arg, "O&:hashbuf" #w, convbin, &in)) goto end; \ - if (in.sz > MASK##n) TYERR("string too long"); \ + if (in.sz > MASK##n) VALERR("too large"); \ STORE##W(b, in.sz); if (gaeadaad_hash(me, b, sizeof(b))) goto end; \ if (gaeadaad_hash(me, in.p, in.sz)) goto end; \ RETURN_ME; \ @@ -2044,7 +2044,7 @@ DOUINTCONV(GHMETH_HASHU_) { \ struct bin in; \ if (!PyArg_ParseTuple(arg, "O&:hashbuf" #w, convbin, &in)) goto end; \ - if (in.sz > MASK##n) TYERR("string too long"); \ + if (in.sz > MASK##n) VALERR("too large"); \ GH_HASHBUF##W(GHASH_H(me), in.p, in.sz); \ RETURN_ME; \ end: \ @@ -2588,7 +2588,7 @@ DOUINTCONV(POLYMETH_HASHU_) struct bin in; \ octet b[SZ_##W]; \ if (!PyArg_ParseTuple(arg, "O&:hashbuf" #w, convbin, &in)) goto end; \ - if (in.sz > MASK##n) TYERR("string too long"); \ + if (in.sz > MASK##n) VALERR("too large"); \ STORE##W(b, in.sz); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \ poly1305_hash(P1305_CTX(me), in.p, in.sz); \ RETURN_ME; \ @@ -2683,7 +2683,7 @@ static const PyMethodDef poly1305hash_pymethods[] = { static const PyTypeObject poly1305cls_pytype_skel = { PyVarObject_HEAD_INIT(0, 0) /* Header */ - "Poly1305Class", /* @tp_name@ */ + "_Poly1305Class", /* @tp_name@ */ sizeof(PyHeapTypeObject), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -3081,7 +3081,7 @@ DOUINTCONV(SHAKEMETH_HASHU_) struct bin in; \ octet b[SZ_##W]; \ if (!PyArg_ParseTuple(arg, "O&:hashbuf" #w, convbin, &in)) goto end; \ - if (in.sz > MASK##n) TYERR("string too long"); \ + if (in.sz > MASK##n) VALERR("too large"); \ if (shake_check(me, 0)) goto end; \ STORE##W(b, in.sz); shake_hash(SHAKE_H(me), b, sizeof(b)); \ shake_hash(SHAKE_H(me), in.p, in.sz); \ @@ -3898,7 +3898,7 @@ void algorithms_pyinsert(PyObject *mod) INSERT("GMACHash", gmhash_pytype); INSERT("gcmacs", make_algtab(gmactab, sizeof(gcmac *), mac_namefn, mac_valfn)); - INSERT("Poly1305Class", poly1305cls_pytype); + INSERT("_Poly1305Class", poly1305cls_pytype); INSERT("poly1305", poly1305key_pytype); INSERT("Poly1305Hash", poly1305hash_pytype); INSERT("Keccak1600", kxvik_pytype);