chiark / gitweb /
*.c: Spruce up class docstrings.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 29 Jul 2017 00:14:12 +0000 (01:14 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 10 Nov 2018 01:30:58 +0000 (01:30 +0000)
Mostly, include constructor synopses.

Also, be consistent about outdenting the docstrings.

13 files changed:
algorithms.c
buffer.c
bytestring.c
ec.c
field.c
group.c
key.c
mp.c
passphrase.c
pgen.c
pubkey.c
rand.c
share.c

index e55456ea605771c1f1ac87ee19821dde6489bdc2..7eab3ae4571c9cb1fe543b7a591621808d9b4180 100644 (file)
@@ -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@ */
index d2aa8d5a0f9b88dd1b11d8dffcd29a90172377e4..bf1cadc554a5cc00d8e070b810a9868d2eb8c4c0 100644 (file)
--- 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@ */
index 2b74648d91d9ca2793f206ba4091e941123465f1..0c68d4321d23e5c78e41b35762b885c0887a52a6 100644 (file)
@@ -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 c6034891ef71215c92d497ed2b1d8275c99f7cd7..da4cc34d5dc095bf1fb1fd90fb34dddd2cbc0382 100644 (file)
--- 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 0a5d908f805dcff2ffe04b2f8d29899bcc14fcec..35cd452f79a1ae7ae2277693e89198b76a94b9e0 100644 (file)
--- 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 cc8bbc1986608450df3132db8bb72b6a33c7aee0..b3c8b6a9d0f0d642f8c222f9941cdd846d560668 100644 (file)
--- 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 8dec99cfa09e22415dfdbc47c0516a676eda24fd..c5b0ac042bfc8bfaa420b921c144256aaaa78dda 100644 (file)
--- 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 88ee73813b538baa863097df8f07232a4fe66523..b253dba7723c77aa7f9d041b8a053353c9fb1e6e 100644 (file)
--- 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@ */
index 7e28f93fdd926f00bf28d7bb0c0e40f29b45fd5f..fd55bb475fbb501064d6496b141fda143913e9b1 100644 (file)
@@ -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 108fa31a5168c19cac5aaa03b59c8752dc6d9da5..8b5f6b23e10d2212ab6273a28bbf4c43acb925a7 100644 (file)
--- 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@ */
index 5167a973791f1930f18b4b7831a6ce6d4aa240ea..56b7d9ca41c5df37188f1bb20746bd2de0aed742 100644 (file)
--- 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 2136c97fc65db6a930efe1b336d571444f9d9664..9da7f663cccc4b0a0d81faebbf82a92e8ac38923 100644 (file)
--- 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 2caa718bb23290ec613a0f378ada8052964ffabe..3d4817e5dac98b7cb8be79e2beb4c2c86d68ae70 100644 (file)
--- 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@ */