BUF_DOSUFFIXES(RBMETH_DECL_GETBUF_)
METH (getmp, "RBUF.getmp() -> X")
METH (getgf, "RBUF.getgf() -> X")
- KWMETH(getecpt, "RBUF.getecpt(curve = None) -> P")
+ KWMETH(getecpt, "RBUF.getecpt([curve = None]) -> P")
METH (getecptraw, "RBUF.getecptraw(CURVE) -> P")
METH (getge, "RBUF.getge(GROUP) -> X")
METH (getgeraw, "RBUF.getgeraw(GROUP) -> X")
METH (mmul, "\
E.mmul([(P0, N0), (P1, N1), ...]) = N0 P0 + N1 P1 + ...")
METH (find, "E.find(X) -> P")
- KWMETH(rand, "E.rand(rng = rand) ->P")
+ KWMETH(rand, "E.rand([rng = rand]) -> P")
#undef METHNAME
{ 0 }
};
static PyMethodDef field_pymethods[] = {
#define METHNAME(name) fmeth_##name
METH (_adopt, "F._adopt(X) -> FE")
- KWMETH(rand, "F.rand(rng = rand) -> FE, uniformly distributed")
+ KWMETH(rand, "F.rand([rng = rand]) -> FE, uniformly distributed")
#undef METHNAME
{ 0 }
};
METH (check, "X.check() -> check X really belongs to its group")
METH (toint, "X.toint() -> X converted to an integer")
KWMETH(toec, "\
-X.toec(curve = ECPt) -> X converted to elliptic curve point")
+X.toec([curve = ECPt]) -> X converted to elliptic curve point")
METH (tobuf, "X.tobuf() -> X in buffer representation")
METH (toraw, "X.toraw() -> X in raw representation")
#undef METHNAME
#define METHNAME(name) gmeth_##name
METH (mexp, "\
G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
- KWMETH(checkgroup, "G.checkgroup(rng = rand): check group is good")
+ KWMETH(checkgroup, "G.checkgroup([rng = rand]): check group is good")
#undef METHNAME
{ 0 }
};
METH (_DHInfo__groupn, 0)
METH (_BinDHInfo__groupn, 0)
KWMETH(_DHInfo_generate, "\
-generate(PBITS, [qbits = 0, event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> D")
+generate(PBITS, [qbits = 0], [event = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0]) -> D")
KWMETH(_DHInfo_genlimlee, "\
-genlimlee(PBITS, QBITS, [event = pgen_nullev, ievent = pgen_nullev,\n\
- rng = rand, nsteps = 0, subgroupp = True]) -> (D, [Q, ...])")
+genlimlee(PBITS, QBITS, [event = pgen_nullev], [ievent = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0], [subgroupp = True]) -> (D, [Q, ...])")
KWMETH(_DHInfo_gendsa, "\
-gendsa(PBITS, QBITS, SEED, [event = pgen_nullev, nsteps = 0])\n\
+gendsa(PBITS, QBITS, SEED, [event = pgen_nullev], [nsteps = 0])\n\
-> (D, SEED, COUNT)")
KWMETH(_DHInfo_genkcdsa, "\
-gendsa(PBITS, QBITS, [event = pgen_nullev, rng = rand, nsteps = 0])\n\
+gendsa(PBITS, QBITS, [event = pgen_nullev], [rng = rand], [nsteps = 0])\n\
-> (D, V)")
#undef METHNAME
{ 0 }
#define METHNAME(func) kdmeth_##func
METH (matchp, "KD.matchp(FILTER) -> BOOL")
METH (split, "KD.split()")
- KWMETH(write, "KD.write(filter = <any>) -> STRING")
- KWMETH(encode, "KD.encode(filter = <any>) -> BYTES")
- KWMETH(copy, "KD.copy(filter = <any>) -> KD")
+ KWMETH(write, "KD.write([filter = <any>]) -> STRING")
+ KWMETH(encode, "KD.encode([filter = <any>]) -> BYTES")
+ KWMETH(copy, "KD.copy([filter = <any>]) -> KD")
METH (plock, "KD.plock(TAG) -> ENCRYPTED-KD")
METH (lock, "KD.lock(KEY) -> ENCRYPTED-KD")
#undef METHNAME
METH (delete, "KEY.delete()")
METH (expire, "KEY.expire()")
METH (used, "KEY.used(TIME)")
- KWMETH(extract, "KEY.extract(FILE, filter = '')")
- KWMETH(fingerprint, "KEY.fingerprint(HASH, filtr = '-secret')")
+ KWMETH(extract, "KEY.extract(FILE, [filter = <any>])")
+ KWMETH(fingerprint, "KEY.fingerprint(HASH, [filter = '-secret'])")
#undef METHNAME
{ 0 }
};
static PyMethodDef keyfile_pymethods[] = {
#define METHNAME(func) kfmeth_##func
METH (save, "KF.save()")
- KWMETH(merge, "KF.merge(FILE, report = <built-in-reporter>)")
- KWMETH(newkey, "KF.newkey(ID, TYPE, exptime = KEXP_FOREVER) -> KEY")
+ KWMETH(merge, "KF.merge(FILE, [report = <built-in-reporter>])")
+ KWMETH(newkey, "KF.newkey(ID, TYPE, "
+ "[exptime = KEXP_FOREVER]) -> KEY")
METH (byid, "KF.byid(KEYID) -> KEY|None")
METH (bytype, "KF.bytype(TYPE) -> KEY|None")
METH (bytag, "KF.bytag(TAG) -> KEY|None")
- KWMETH(qtag, "KF.qtag(TAG, new = KD) -> FULLTAG, KEY, OLDKD")
+ KWMETH(qtag, "KF.qtag(TAG, [new = KD]) -> FULLTAG, KEY, OLDKD")
GMAP_ROMETHODS
#undef METHNAME
{ 0 }
METH (modsqrt, "X.modsqrt(Y) -> square root of Y mod X, if X prime")
METH (leastcongruent,
"X.leastcongruent(B, M) -> smallest Z >= B with Z == X (mod M)")
- KWMETH(primep, "X.primep(rng = rand) -> true/false if X is prime")
- KWMETH(tostring, "X.tostring(radix = 10) -> STR")
- KWMETH(storel, "X.storel(len = -1) -> little-endian bytes")
- KWMETH(storeb, "X.storeb(len = -1) -> big-endian bytes")
+ KWMETH(primep, "X.primep([rng = rand]) -> true/false if X is prime")
+ KWMETH(tostring, "X.tostring([radix = 10]) -> STR")
+ KWMETH(storel, "X.storel([len = -1]) -> little-endian bytes")
+ KWMETH(storeb, "X.storeb([len = -1]) -> big-endian bytes")
KWMETH(storel2c,
- "X.storel2c(len = -1) -> little-endian bytes, two's complement")
+ "X.storel2c([len = -1]) -> little-endian bytes, two's complement")
KWMETH(storeb2c,
- "X.storeb2c(len = -1) -> big-endian bytes, two's complement")
+ "X.storeb2c([len = -1]) -> big-endian bytes, two's complement")
METH (tobuf, "X.tobuf() -> buffer format")
#undef METHNAME
{ 0 }
implicit conversions from `PrimeFilter', and other objects which\n\
convert to `long'.\n\
\n\
-Constructor MP(X, radix = R) attempts to convert X to an `MP'. If\n\
+Constructor MP(X, [radix = R]) attempts to convert X to an `MP'. If\n\
X is a string, it's read in radix-R form, or we look for a prefix\n\
if R = 0. Other acceptable things are field elements, elliptic curve\n\
points, group elements, Python `int' and `long' objects, and anything\n\
METH (irreduciblep, "X.irreduciblep() -> true/false")
#undef METHNAME
#define METHNAME(func) mpmeth_##func
- KWMETH(tostring, "X.tostring(radix = 10) -> STR")
- KWMETH(storel, "X.storel(len = -1) -> little-endian bytes")
- KWMETH(storeb, "X.storeb(len = -1) -> big-endian bytes")
+ KWMETH(tostring, "X.tostring([radix = 10]) -> STR")
+ KWMETH(storel, "X.storel([len = -1]) -> little-endian bytes")
+ KWMETH(storeb, "X.storeb([len = -1]) -> big-endian bytes")
KWMETH(storel2c,
- "X.storel2c(len = -1) -> little-endian bytes, two's complement")
+ "X.storel2c([len = -1]) -> little-endian bytes, two's complement")
KWMETH(storeb2c,
- "X.storeb2c(len = -1) -> big-endian bytes, two's complement")
+ "X.storeb2c([len = -1]) -> big-endian bytes, two's complement")
METH (tobuf, "X.tobuf() -> buffer format")
#undef METHNAME
{ 0 }
"Binary polynomials. Support almost all the standard arithmetic\n\
operations.\n\
\n\
-Constructor GF(X, radix = R) attempts to convert X to a `GF'. If\n\
+Constructor GF(X, [radix = R]) attempts to convert X to a `GF'. If\n\
X is a string, it's read in radix-R form, or we look for a prefix\n\
if R = 0. Other acceptable things are field elements, elliptic curve\n\
points, group elements, Python `int' and `long' objects, and anything\n\
static PyMethodDef methods[] = {
#define METHNAME(func) meth_##func
KWMETH(_MP_fromstring, "\
-fromstring(STR, radix = 0) -> (X, REST)\n\
+fromstring(STR, [radix = 0]) -> (X, REST)\n\
\n\
Parse STR as a large integer, according to radix. If radix is zero,\n\
read a prefix from STR to decide radix: allow `0' for octal, `0x' for hex\n\
or `R_' for other radix R.")
KWMETH(_GF_fromstring, "\
-fromstring(STR, radix = 0) -> (X, REST)\n\
+fromstring(STR, [radix = 0]) -> (X, REST)\n\
\n\
Parse STR as a binary polynomial, according to radix. If radix is zero,\n\
read a prefix from STR to decide radix: allow `0' for octal, `0x' for hex\n\
METH (_PrimeFilter_smallfactor, "smallfactor(X) -> PGRC")
METH (_RabinMiller_iters, "iters(NBITS) -> NITERS")
KWMETH(pgen, "\
-pgen(START, [name = 'p', stepper = PrimeGenStepper(2),\n\
- tester = PrimeGenTester(), event = pgen_nullev,\n\
- nsteps = 0, ntests = RabinMiller.iters(START.nbits)]) -> P")
+pgen(START, [name = 'p'[, [stepper = PrimeGenStepper(2)],\n\
+ [tester = PrimeGenTester()], [event = pgen_nullev],\n\
+ [nsteps = 0], [ntests = RabinMiller.iters(START.nbits)]) -> P")
KWMETH(strongprime_setup, "\
-strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> (START, JUMP)")
+strongprime_setup(NBITS, [name = 'p'], [event = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0]) -> (START, JUMP)")
KWMETH(strongprime, "\
-strongprime(NBITS, [name = 'p', event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> P")
+strongprime(NBITS, [name = 'p'], [event = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0]) -> P")
KWMETH(limlee, "\
-limlee(PBITS, QBITS, [name = 'p', event = pgen_nullev,\n\
- ievent = pgen_nullev, rng = rand, nsteps = 0]) -> (P, [Q, ...])")
+limlee(PBITS, QBITS, [name = 'p'], [event = pgen_nullev],\n\
+ [ievent = pgen_nullev], [rng = rand], [nsteps = 0]) -> (P, [Q, ...])")
#undef METHNAME
{ 0 }
};
static PyMethodDef dsapriv_pymethods[] = {
#define METHNAME(name) dsameth_##name
- KWMETH(sign, "D.sign(MSG, k = K) -> R, S")
+ KWMETH(sign, "D.sign(MSG, [k = K]) -> R, S")
#undef METHNAME
{ 0 }
};
static PyMethodDef kcdsapriv_pymethods[] = {
#define METHNAME(name) kcdsameth_##name
- KWMETH(sign, "D.sign(MSG, k = K) -> R, S")
+ KWMETH(sign, "D.sign(MSG, [k = K]) -> R, S")
#undef METHNAME
{ 0 }
};
static PyMethodDef rsapriv_pymethods[] = {
#define METHNAME(name) rsameth_##name
- KWMETH(privop, "R.privop(X, rng = None) -> X^D (mod N)")
+ KWMETH(privop, "R.privop(X, [rng = None]) -> X^D (mod N)")
#undef METHNAME
{ 0 }
};
KWMETH(_pss_encode, 0)
KWMETH(_pss_decode, 0)
KWMETH(_RSAPriv_generate, "\
-generate(NBITS, [event = pgen_nullev, rng = rand, nsteps = 0]) -> R")
+generate(NBITS, [event = pgen_nullev], [rng = rand], [nsteps = 0]) -> R")
#define DEFMETH(X, x) \
METH (x, "\
" #x "(KEY, PUBLIC) -> SHARED")
METH (ed##_pubkey, "\
" #ed "_pubkey(KEY) -> PUBLIC") \
KWMETH(ed##_sign, "\
-" #ed "_sign(KEY, MSG, [pub = PUBLIC, " \
- "perso = STRING, phflag = BOOL]) -> SIG") \
+" #ed "_sign(KEY, MSG, [pub = PUBLIC], " \
+ "[perso = STRING], [phflag = BOOL]) -> SIG") \
KWMETH(ed##_verify, "\
" #ed "_verify(PUBLIC, MSG, SIG, " \
- "[perso = STRING, phflag = BOOL]) -> BOOL")
+ "[perso = STRING], [phflag = BOOL]) -> BOOL")
EDDSAS(DEFMETH)
#undef DEFMETH
#undef METHNAME
static PyMethodDef methods[] = {
#define METHNAME(name) meth_##name
KWMETH(_BBSPriv_generate, "\
-generate(NBITS, [event = pgen_nullev, rng = rand, nsteps = 0, seed = 2])")
+generate(NBITS, [event = pgen_nullev], [rng = rand],\n\
+ [nsteps = 0], [seed = 2])")
#undef METHNAME
{ 0 }
};