char *argv0;
if (!PyArg_ParseTuple(arg, "s:_ego", &argv0))
return (0);
- if (strcmp(QUIS, "<UNNAMED>") == 0)
+ if (STRCMP(QUIS, ==, "<UNNAMED>"))
ego(argv0);
RETURN_NONE;
}
if (!Py_HashRandomizationFlag) return;
seed = getenv("PYTHONHASHSEED");
- if (!seed || strcmp(seed, "random") == 0) r = GR_WORD(&rand_global);
+ if (!seed || STRCMP(seed, ==, "random")) r = GR_WORD(&rand_global);
else r = strtoul(seed, 0, 0);
if (!r) r = 0xe011f220; /* zero doesn't work well */
unihash_setkey(&unihash_global, r);
Maintainer: Mark Wooding <mdw@distorted.org.uk>
Build-Depends: debhelper (>= 10), pkg-config,
python (>= 2.6.6-3~), python-all-dev,
- mlib-dev (>= 2.2.2.1), catacomb-dev (>= 2.5.0)
+ mlib-dev (>= 2.4.99~), catacomb-dev (>= 2.5.0)
Standards-Version: 3.8.0
Package: python-catacomb
return (0);
a = F_OUT(f, MP_NEW, c->a);
b = F_OUT(f, MP_NEW, c->b);
- if (strcmp(EC_NAME(c), "prime") == 0)
+ if (STRCMP(EC_NAME(c), ==, "prime"))
c = ec_prime(f, a, b);
- else if (strcmp(EC_NAME(c), "primeproj") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "primeproj"))
c = ec_primeproj(f, a, b);
- else if (strcmp(EC_NAME(c), "bin") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "bin"))
c = ec_bin(f, a, b);
- else if (strcmp(EC_NAME(c), "binproj") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "binproj"))
c = ec_binproj(f, a, b);
else
c = 0;
else
Py_INCREF(fobj);
assert(FIELD_F(fobj) == c->f);
- if (strcmp(EC_NAME(c), "prime") == 0)
+ if (STRCMP(EC_NAME(c), ==, "prime"))
ty = ecprimecurve_pytype;
- else if (strcmp(EC_NAME(c), "primeproj") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "primeproj"))
ty = ecprimeprojcurve_pytype;
- else if (strcmp(EC_NAME(c), "bin") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "bin"))
ty = ecbincurve_pytype;
- else if (strcmp(EC_NAME(c), "binproj") == 0)
+ else if (STRCMP(EC_NAME(c), ==, "binproj"))
ty = ecbinprojcurve_pytype;
else
abort();
{
PyTypeObject *ty;
- if (strcmp(F_NAME(f), "prime") == 0) ty = primefield_pytype;
- else if (strcmp(F_NAME(f), "niceprime") == 0) ty = niceprimefield_pytype;
- else if (strcmp(F_NAME(f), "binpoly") == 0) ty = binpolyfield_pytype;
- else if (strcmp(F_NAME(f), "binnorm") == 0) ty = binnormfield_pytype;
+ if (STRCMP(F_NAME(f), ==, "prime")) ty = primefield_pytype;
+ else if (STRCMP(F_NAME(f), ==, "niceprime")) ty = niceprimefield_pytype;
+ else if (STRCMP(F_NAME(f), ==, "binpoly")) ty = binpolyfield_pytype;
+ else if (STRCMP(F_NAME(f), ==, "binnorm")) ty = binnormfield_pytype;
else abort();
return (field_dopywrap(ty, f));
}
field *field_copy(field *f)
{
- if (strcmp(F_NAME(f), "prime") == 0)
+ if (STRCMP(F_NAME(f), ==, "prime"))
f = field_prime(f->m);
- else if (strcmp(F_NAME(f), "niceprime") == 0)
+ else if (STRCMP(F_NAME(f), ==, "niceprime"))
f = field_niceprime(f->m);
- else if (strcmp(F_NAME(f), "binpoly") == 0)
+ else if (STRCMP(F_NAME(f), ==, "binpoly"))
f = field_binpoly(f->m);
- else if (strcmp(F_NAME(f), "binnorm") == 0) {
+ else if (STRCMP(F_NAME(f), ==, "binnorm")) {
fctx_binnorm *fc = (fctx_binnorm *)f;
f = field_binnorm(f->m, fc->ntop.r[fc->ntop.n - 1]);
} else
group *group_copy(group *g)
{
- if (strcmp(G_NAME(g), "prime") == 0) {
+ if (STRCMP(G_NAME(g), ==, "prime")) {
gctx_prime *gc = (gctx_prime *)g;
gprime_param gp;
gp.g = G_TOINT(g, MP_NEW, g->g);
gp.q = gc->g.r;
g = group_prime(&gp);
MP_DROP(gp.g);
- } else if (strcmp(G_NAME(g), "bin") == 0) {
+ } else if (STRCMP(G_NAME(g), ==, "bin")) {
gctx_bin *gc = (gctx_bin *)g;
gbin_param gb;
gb.g = G_TOINT(g, MP_NEW, g->g);
gb.q = gc->g.r;
g = group_binary(&gb);
MP_DROP(gb.g);
- } else if (strcmp(G_NAME(g), "ec") == 0) {
+ } else if (STRCMP(G_NAME(g), ==, "ec")) {
gctx_ec *gc = (gctx_ec *)g;
ec_info ei;
if ((ei.c = eccurve_copy(gc->ei.c)) == 0)
{
PyTypeObject *ty;
- if (strcmp(G_NAME(g), "prime") == 0) ty = primegroup_pytype;
- else if (strcmp(G_NAME(g), "bin") == 0) ty = bingroup_pytype;
- else if (strcmp(G_NAME(g), "ec") == 0) ty = ecgroup_pytype;
+ if (STRCMP(G_NAME(g), ==, "prime")) ty = primegroup_pytype;
+ else if (STRCMP(G_NAME(g), ==, "bin")) ty = bingroup_pytype;
+ else if (STRCMP(G_NAME(g), ==, "ec")) ty = ecgroup_pytype;
else abort();
return (group_dopywrap(ty, g));
}
if (!PyType_Check(cty) || !PyType_IsSubtype(cty, ecpt_pytype))
TYERR("want subtype of catacomb.ECPt");
Py_INCREF((PyObject *)cty);
- } else if (strcmp(G_NAME(g), "ec") == 0) {
+ } else if (STRCMP(G_NAME(g), ==, "ec")) {
c = eccurve_copy(((gctx_ec *)g)->ei.c);
cty = (PyTypeObject *)eccurve_pywrap(0, c);
} else {
PyTypeObject *ty = grand_pytype;
PyObject *ob;
- if (strcmp(r->ops->name, "rand") == 0) ty = truerand_pytype;
- else if (strcmp(r->ops->name, "lcrand") == 0) ty = lcrand_pytype;
- else if (strcmp(r->ops->name, "fibrand") == 0) ty = fibrand_pytype;
- else if (strcmp(r->ops->name, "dsarand") == 0) ty = dsarand_pytype;
- else if (strcmp(r->ops->name, "bbs") == 0) ty = bbs_pytype;
- else if (strcmp(r->ops->name, "sslprf") == 0) ty = sslprf_pytype;
- else if (strcmp(r->ops->name, "tlsdx") == 0) ty = tlsdx_pytype;
- else if (strcmp(r->ops->name, "tlsprf") == 0) ty = tlsprf_pytype;
+ if (STRCMP(r->ops->name, ==, "rand")) ty = truerand_pytype;
+ else if (STRCMP(r->ops->name, ==, "lcrand")) ty = lcrand_pytype;
+ else if (STRCMP(r->ops->name, ==, "fibrand")) ty = fibrand_pytype;
+ else if (STRCMP(r->ops->name, ==, "dsarand")) ty = dsarand_pytype;
+ else if (STRCMP(r->ops->name, ==, "bbs")) ty = bbs_pytype;
+ else if (STRCMP(r->ops->name, ==, "sslprf")) ty = sslprf_pytype;
+ else if (STRCMP(r->ops->name, ==, "tlsdx")) ty = tlsdx_pytype;
+ else if (STRCMP(r->ops->name, ==, "tlsprf")) ty = tlsprf_pytype;
else if ((ob = PyDict_GetItemString(gccrands_dict, r->ops->name)) != 0)
ty = (PyTypeObject *)ob;
return (grand_dopywrap(ty, r, f));
import mdwsetup as MS
MS.pkg_config('catacomb', '2.5.0')
-MS.pkg_config('mLib', '2.2.2.1')
+MS.pkg_config('mLib', '2.4.99~')
cat = DC.Extension('catacomb._base',
['catacomb.c', 'bytestring.c', 'buffer.c',