From 06cd26e87f5b839d40f0e7b57e38aea6c231b385 Mon Sep 17 00:00:00 2001 Message-Id: <06cd26e87f5b839d40f0e7b57e38aea6c231b385.1716980400.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 29 Jul 2017 01:14:12 +0100 Subject: [PATCH] *.c: Spruce up class docstrings. Organization: Straylight/Edgeware From: Mark Wooding Mostly, include constructor synopses. Also, be consistent about outdenting the docstrings. --- algorithms.c | 22 ++++++++++++---------- buffer.c | 4 ++-- bytestring.c | 2 +- ec.c | 20 +++++++++++++------- field.c | 10 +++++----- group.c | 12 ++++++------ key.c | 17 +++++++++-------- mp.c | 22 +++++++++++----------- passphrase.c | 2 +- pgen.c | 10 +++++----- pubkey.c | 13 +++++++------ rand.c | 22 +++++++++++++--------- share.c | 12 ++++++++---- 13 files changed, 93 insertions(+), 75 deletions(-) diff --git a/algorithms.c b/algorithms.c index e55456e..7eab3ae 100644 --- a/algorithms.c +++ b/algorithms.c @@ -261,7 +261,7 @@ static PyTypeObject keysz_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key size constraints.", +"Key size constraints. Abstract.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -309,7 +309,8 @@ static PyTypeObject keyszany_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key size constraints. This object imposes no constraints on size.", +"KeySZAny(DEFAULT)\n\ + Key size constraints. This object imposes no constraints on size.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -357,8 +358,9 @@ static PyTypeObject keyszrange_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key size constraints. This object asserts minimum and maximum (if\n\ -sizes, and requires the key length to be a multiple of some value.", +"KeySZRange(DEFAULT, [min = 0], [max = 0], [mod = 1])\n\ + Key size constraints. Key size must be between MIN and MAX inclusive,\n\ + and be a multiple of MOD.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -406,8 +408,8 @@ static PyTypeObject keyszset_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key size constraints. This object requires the key to be one of a\n\ -few listed sizes.", +"KeySZSet(DEFAULT, SEQ)\n\ + Key size constraints. Key size must be DEFAULT or one in SEQ.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1482,7 +1484,7 @@ static PyTypeObject poly1305key_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Poly1305 key.", +"poly1305(K): Poly1305 key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1719,7 +1721,7 @@ static PyTypeObject kxvik_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Keccak-p[1600, n] state.", +"Keccak1600([nround = 24]): Keccak-p[1600, n] state.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2016,7 +2018,7 @@ static PyTypeObject shake128_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"SHAKE128/cSHAKE128 XOF.", +"Shake128([perso = STR], [func = STR]): SHAKE128/cSHAKE128 XOF.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2064,7 +2066,7 @@ static PyTypeObject shake256_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"SHAKE256/cSHAKE256 XOF.", +"Shake256([perso = STR], [func = STR]): SHAKE256/cSHAKE256 XOF.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/buffer.c b/buffer.c index d2aa8d5..bf1cadc 100644 --- a/buffer.c +++ b/buffer.c @@ -308,7 +308,7 @@ static PyTypeObject rbuf_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "A read buffer.", +"ReadBuffer(STR): a read buffer.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -545,7 +545,7 @@ static PyTypeObject wbuf_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "A write buffer.", +"WriteBuffer([size = ?]): a write buffer.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/bytestring.c b/bytestring.c index 2b74648..0c68d43 100644 --- a/bytestring.c +++ b/bytestring.c @@ -211,7 +211,7 @@ static PyTypeObject bytestring_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Byte string class.", +"ByteString(STR): byte string class.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/ec.c b/ec.c index c603489..da4cc34 100644 --- a/ec.c +++ b/ec.c @@ -645,7 +645,9 @@ static PyTypeObject ecpt_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Elliptic curve points, not associated with any curve.", +"ECPt([X, [Y]]): elliptic curve points, not associated with any curve.\n\ + X alone may be None, an existing point, a string 'X, Y', an\n\ + x-coordinate, or a pair (X, Y); X and Y should be a coordinate pair.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1095,7 +1097,7 @@ static PyTypeObject eccurve_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "An elliptic curve. Abstract class.", +"An elliptic curve. Abstract class.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1149,7 +1151,8 @@ static PyTypeObject ecprimecurve_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "An elliptic curve over a prime field. Use ecprimeprojcurve.", +"ECPrimeCurve(FIELD, A, B): an elliptic curve over a prime field.\n\ + Use ECPrimeProjCurve instead.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1203,7 +1206,8 @@ static PyTypeObject ecprimeprojcurve_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "An elliptic curve over a prime field, using projective coordinates.", +"ECPrimeProjCurve(FIELD, A, B): an elliptic curve over a prime field\n\ + using projective coordinates.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1257,7 +1261,8 @@ static PyTypeObject ecbincurve_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "An elliptic curve over a binary field. Use ecbinprojcurve.", +"ECBinCurve(FIELD, A, B): an elliptic curve over a binary field.\n\ + Use ECBinProjCurve instead.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1311,7 +1316,8 @@ static PyTypeObject ecbinprojcurve_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "An elliptic curve over a binary field, using projective coordinates.", +"ECBinProjCurve(FIELD, A, B): an elliptic curve over a binary field,\n\ + using projective coordinates.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1516,7 +1522,7 @@ static PyTypeObject ecinfo_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Elliptic curve domain parameters.", +"ECInfo(CURVE, G, R, H): elliptic curve domain parameters.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/field.c b/field.c index 0a5d908..35cd452 100644 --- a/field.c +++ b/field.c @@ -641,7 +641,7 @@ static PyTypeObject primefield_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Prime fields.", +"PrimeField(P): prime fields.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -708,7 +708,7 @@ static PyTypeObject niceprimefield_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Nice prime fields.", +"NicePrimeField(P): prime field using Solinas reduction.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -768,7 +768,7 @@ static PyTypeObject binfield_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Binary fields. Abstract class.", +"Binary fields. Abstract class.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -841,7 +841,7 @@ static PyTypeObject binpolyfield_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Binary fields with polynomial basis representation.", +"BinPolyField(P): binary fields with polynomial basis representation.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -923,7 +923,7 @@ static PyTypeObject binnormfield_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Binary fields with normal basis representation.", +"BinNormField(P, BETA): binary fields with normal basis representation.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/group.c b/group.c index cc8bbc1..b3c8b6a 100644 --- a/group.c +++ b/group.c @@ -325,7 +325,7 @@ static PyTypeObject fginfo_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Abstract base class for field-group information objects.", +"Abstract base class for field-group information objects.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -373,7 +373,7 @@ static PyTypeObject dhinfo_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Standard (integer) Diffie-Hellman group information.", +"DHInfo(P, R, G): standard (integer) Diffie-Hellman group information.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -421,7 +421,7 @@ static PyTypeObject bindhinfo_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Binary-field Diffie-Hellman group information.", +"BinDHInfo(P, R, G): binary-field Diffie-Hellman group information.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1186,7 +1186,7 @@ static PyTypeObject primegroup_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Subgroups of prime fields.", +"PrimeGroup(INFO): subgroups of prime fields.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1263,7 +1263,7 @@ static PyTypeObject bingroup_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Subgroups of binary fields.", +"BinGroup(INFO): subgroups of binary fields.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1341,7 +1341,7 @@ static PyTypeObject ecgroup_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Elliptic curve groups.", +"ECGroup(INFO): elliptic curve groups.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/key.c b/key.c index 8dec99c..c5b0ac0 100644 --- a/key.c +++ b/key.c @@ -583,7 +583,7 @@ static PyTypeObject keydatabin_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for binary keys.", +"KeyDataBinary(KEY, [flags = 0]): key data for binary keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -720,7 +720,7 @@ static PyTypeObject keydataenc_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for encrypted keys.", +"KeyDataEncrypted(KEY, [flags = 0]): key data for encrypted keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -796,7 +796,7 @@ static PyTypeObject keydatamp_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for large-integer keys.", +"KeyDataMP(KEY, [flags = 0]): key data for large-integer keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -871,7 +871,7 @@ static PyTypeObject keydatastr_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for string keys.", +"KeyDataString(KEY, [flags = 0]): key data for string keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -951,7 +951,7 @@ static PyTypeObject keydataec_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for elliptic-curve keys.", +"KeyDataECPt(KEY, [flags = 0]): key data for elliptic-curve keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1157,7 +1157,7 @@ static PyTypeObject keydatastruct_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key data for structured keys.", +"KeyDataStructured([subkeys = []]): key data for structured keys.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1645,7 +1645,7 @@ static PyTypeObject key_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Key object.", +"Key(KF, ID, TYPE, [exptime = KEXP_FOREVER]): key object.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2040,7 +2040,8 @@ static PyTypeObject keyfile_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Keyring file.", +"KeyFile(FILE, [how = KOPEN_READ], [report = ?]): Keyring file.\n\ + calls REPORT(FILE, LINE, MSG) on problems", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/mp.c b/mp.c index 88ee738..b253dba 100644 --- a/mp.c +++ b/mp.c @@ -892,13 +892,13 @@ static PyTypeObject mp_pytype_skel = { "Multiprecision integers, similar to `long' but more efficient and\n\ versatile. Support all the standard arithmetic operations.\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 ints and longs.\n\ \n\ Notes:\n\ \n\ - * Use `//' for division. MPs don't have `/' division.", + * Use `//' for integer division. `/' gives exact rational division.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1101,7 +1101,7 @@ static PyTypeObject *mpmul_pytype, mpmul_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"An object for multiplying many small integers.", +"MPMul(N_0, N_1, ....): an object for multiplying many small integers.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1368,7 +1368,7 @@ static PyTypeObject *mpmont_pytype, mpmont_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"A Montgomery reduction context.", +"MPMont(N): a Montgomery reduction context.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1507,7 +1507,7 @@ static PyTypeObject *mpbarrett_pytype, mpbarrett_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"A Barrett reduction context.", +"MPBarrett(N): a Barrett reduction context.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1635,7 +1635,7 @@ static PyTypeObject *mpreduce_pytype, mpreduce_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"A reduction context for reduction modulo primes of special form.", +"MPReduce(N): a reduction context for reduction modulo Solinas primes.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1804,7 +1804,7 @@ static PyTypeObject *mpcrt_pytype, mpcrt_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"A context for the solution of Chinese Remainder Theorem problems.", +"MPCRT(SEQ): a context for solving Chinese Remainder Theorem problems.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2099,7 +2099,7 @@ but it's much easier to type than `p2' or `c2' or whatever.\n\ \n\ Notes:\n\ \n\ - * Use `//' for division. GFs don't have `/' division.", + * Use `//' for Euclidean division. `/' gives exact rational division.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2310,7 +2310,7 @@ static PyTypeObject *gfreduce_pytype, gfreduce_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"A reduction context for reduction modulo sparse irreducible polynomials.", +"GFReduce(N): a context for reduction modulo sparse polynomials.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -2444,8 +2444,8 @@ static PyTypeObject gfn_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"An object for transforming elements of binary fields between polynomial\n\ -and normal basis representations.", +"GFN(P, BETA): an object for transforming elements of binary fields\n\ + between polynomial and normal basis representations.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/passphrase.c b/passphrase.c index 7e28f93..fd55bb4 100644 --- a/passphrase.c +++ b/passphrase.c @@ -152,7 +152,7 @@ static PyTypeObject pixie_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Passphrase pixie connection.", +"Pixie([socket = ?]): passphrase pixie connection.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/pgen.c b/pgen.c index 108fa31..8b5f6b2 100644 --- a/pgen.c +++ b/pgen.c @@ -219,7 +219,7 @@ static PyTypeObject pfilt_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Small-primes filter.", +"PrimeFilter(X): small-primes filter.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -352,7 +352,7 @@ static PyTypeObject rabin_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Rabin-Miller strong primality test.", +"RabinMiller(X): Rabin-Miller strong primality test.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -725,7 +725,7 @@ static PyTypeObject pgstep_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ - "Simple prime-number stepper with small-factors filter.", +"PrimeGenStepper(STEP): simple stepper with small-factors filter.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -807,7 +807,7 @@ static PyTypeObject pgjump_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Stepper for larger steps, with small-factors filter.", +"PrimeGenJumper(JUMP): stepper for larger steps with small-factors filter.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -868,7 +868,7 @@ static PyTypeObject pgtest_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Rabin-Miller tester.", +"PrimeGenTester(): Rabin-Miller tester.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/pubkey.c b/pubkey.c index 5167a97..56b7d9c 100644 --- a/pubkey.c +++ b/pubkey.c @@ -247,7 +247,7 @@ static PyTypeObject dsapub_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"DSA public key information.", +"DSAPub(GROUP, P, [hash = sha], [rng = rand]): DSA public key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -295,7 +295,7 @@ static PyTypeObject dsapriv_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"DSA private key information.", +"DSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): DSA private key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -467,7 +467,7 @@ static PyTypeObject kcdsapub_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"KCDSA public key information.", +"KCDSAPub(GROUP, P, [hash = sha], [rng = rand]): KCDSA public key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -515,7 +515,7 @@ static PyTypeObject kcdsapriv_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"KCDSA private key information.", +"KCDSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): KCDSA private key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -813,7 +813,7 @@ static PyTypeObject rsapub_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"RSA public key information.", +"RSAPub(N, E): RSA public key.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -861,7 +861,8 @@ static PyTypeObject rsapriv_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"RSA private key information.", +"RSAPriv(..., [rng = rand]): RSA private key.\n\ + Keywords: n, e, d, p, q, dp, dq, q_inv; must provide enough", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/rand.c b/rand.c index 2136c97..9da7f66 100644 --- a/rand.c +++ b/rand.c @@ -351,7 +351,7 @@ static PyTypeObject lcrand_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Linear congruential generator.", +"LCRand([seed = 0]): linear congruential generator.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -408,7 +408,7 @@ static PyTypeObject fibrand_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Fibonacci generator.", +"FibRand([seed = 0]): Fibonacci generator.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -553,7 +553,7 @@ static PyTypeObject truerand_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"True random number source.", +"TrueRand(): true random number source.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -996,7 +996,8 @@ static PyTypeObject sslprf_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Random number generator for SSL master secret.", +"SSLRand(KEY, SEED, [ohash = md5], [ihash = sha]):\n\ + RNG for SSL master secret.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1044,7 +1045,8 @@ static PyTypeObject tlsdx_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"TLS data expansion function.", +"TLSDataExpansion(KEY, SEED, [mac = sha_hmac]):\n\ + TLS data expansion function.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1092,7 +1094,8 @@ static PyTypeObject tlsprf_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"TLS pseudorandom function.", +"TLSPRF(KEY, SEED, [lmac = md5_hmac], [rmac = sha_hmac]):\n\ + TLS pseudorandom function.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1172,7 +1175,7 @@ static PyTypeObject dsarand_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Pseudorandom number generator for constructing DSA parameters.", +"DSARand(SEED): pseudorandom number generator for DSA parameters.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1304,7 +1307,7 @@ static PyTypeObject bbs_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Blum-Blum-Shub strong pseudorandom number generator.", +"BlumBlumShub(N, [x = 2]): Blum-Blum-Shub pseudorandom number generator.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -1462,7 +1465,8 @@ static PyTypeObject bbspriv_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Blum-Blum-Shub strong pseudorandom generator, with private key.", +"BBSPriv(..., seed = 2]): Blum-Blum-Shub, with private key.\n\ + Keywords: n, p, q; must provide at least two", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ diff --git a/share.c b/share.c index 2caa718..3d4817e 100644 --- a/share.c +++ b/share.c @@ -174,7 +174,8 @@ static PyTypeObject gfsharesplit_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Binary field secret sharing: split secret into shares.", +"GFShareSplit(THRESHOLD, SECRET, [rng = rand]): binary-field sharing:\n\ + split secret into shares.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -295,7 +296,8 @@ static PyTypeObject gfsharejoin_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Binary field secret sharing: join shares to recover secret.", +"GFShareJoin(THRESHOLD, SIZE): binary field sharing:\n\ + join shares to recover secret.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -467,7 +469,8 @@ static PyTypeObject sharesplit_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Prime field secret sharing: split secret into shares.", +"ShareSplit(THRESHOLD, SECRET, [modulus = ?], [rng = rand]):\n\ + prime field secret sharing: split secret into shares.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ @@ -590,7 +593,8 @@ static PyTypeObject sharejoin_pytype_skel = { Py_TPFLAGS_BASETYPE, /* @tp_doc@ */ -"Prime field secret sharing: join shares to recover secret.", +"ShareJoin(THRESHOLD, MODULUS): prime field secret sharing:\n\ + join shares to recover secret.", 0, /* @tp_traverse@ */ 0, /* @tp_clear@ */ -- [mdw]