chiark / gitweb /
*.c: Reformat docstrings.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 22 Nov 2019 20:30:31 +0000 (20:30 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 21:42:39 +0000 (22:42 +0100)
No functional changes here: just changing how the strings are
represented in the source.

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

index 886c159106f7fbba57c5de46975748f0e2cde0c2..d190a08ba15b71d80ac9f233d33944f5cebb2cf8 100644 (file)
@@ -216,7 +216,7 @@ static PyObject *ksget_max(PyObject *me, void *hunoz)
 static PyMemberDef keysz_pymembers[] = {
 #define MEMBERSTRUCT keysz_pyobj
 #define default dfl /* ugh! */
-  MEMBER(default, T_INT, READONLY, "KSZ.default -> default key size")
+  MEMBER(default, T_INT,  READONLY, "KSZ.default -> default key size")
 #undef default
 #undef MEMBERSTRUCT
   { 0 }
@@ -224,33 +224,33 @@ static PyMemberDef keysz_pymembers[] = {
 
 static PyGetSetDef keyszany_pygetset[] = {
 #define GETSETNAME(op, name) ka##op##_##name
-  GET  (min,                   "KSZ.min -> smallest allowed key size")
-  GET  (max,                   "KSZ.max -> largest allowed key size")
+  GET  (min,           "KSZ.min -> smallest allowed key size")
+  GET  (max,           "KSZ.max -> largest allowed key size")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMemberDef keyszrange_pymembers[] = {
 #define MEMBERSTRUCT keyszrange_pyobj
-  MEMBER(min, T_INT, READONLY, "KSZ.min -> smallest allowed key size")
-  MEMBER(max, T_INT, READONLY, "KSZ.max -> largest allowed key size")
-  MEMBER(mod, T_INT, READONLY,
-        "KSZ.mod -> key size must be a multiple of this")
+  MEMBER(min,  T_INT,    READONLY, "KSZ.min -> smallest allowed key size")
+  MEMBER(max,  T_INT,    READONLY, "KSZ.max -> largest allowed key size")
+  MEMBER(mod,  T_INT,    READONLY,
+                           "KSZ.mod -> key size must be a multiple of this")
 #undef MEMBERSTRUCT
   { 0 }
 };
 
 static PyGetSetDef keyszset_pygetset[] = {
 #define GETSETNAME(op, name) ks##op##_##name
-  GET  (min,                   "KSZ.min -> smallest allowed key size")
-  GET  (max,                   "KSZ.max -> largest allowed key size")
+  GET  (min,           "KSZ.min -> smallest allowed key size")
+  GET  (max,           "KSZ.max -> largest allowed key size")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMemberDef keyszset_pymembers[] = {
 #define MEMBERSTRUCT keyszset_pyobj
-  MEMBER(set, T_OBJECT, READONLY,      "KSZ.set -> allowed key sizes")
+  MEMBER(set,  T_OBJECT, READONLY, "KSZ.set -> allowed key sizes")
 #undef MEMBERSTRUCT
   { 0 }
 };
@@ -280,7 +280,7 @@ static PyTypeObject keysz_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Key size constraints.  Abstract.",
+  "Key size constraints.  Abstract.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -328,8 +328,8 @@ static PyTypeObject keyszany_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeySZAny(DEFAULT)\n\
-  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@ */
@@ -377,9 +377,9 @@ static PyTypeObject keyszrange_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"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.",
+  "KeySZRange(DEFAULT, [min = 0], [max = 0], [mod = 1])\n"
+  "  Key size constraints: size must be between MIN and MAX inclusive, and\n"
+   be a multiple of MOD.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -427,8 +427,8 @@ static PyTypeObject keyszset_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeySZSet(DEFAULT, SEQ)\n\
-  Key size constraints.  Key size must be DEFAULT or one in SEQ.",
+  "KeySZSet(DEFAULT, SEQ)\n"
+  "  Key size constraints: size must be DEFAULT or an element of SEQ.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -629,21 +629,21 @@ end:
 
 static PyGetSetDef gccipher_pygetset[] = {
 #define GETSETNAME(op, name) gcc##op##_##name
-  GET  (keysz,                 "CC.keysz -> acceptable key sizes")
-  GET  (blksz,                 "CC.blksz -> block size, or zero")
-  GET  (name,                  "CC.name -> name of this kind of cipher")
+  GET  (keysz,         "CC.keysz -> acceptable key sizes")
+  GET  (blksz,         "CC.blksz -> block size, or zero")
+  GET  (name,          "CC.name -> name of this kind of cipher")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef gcipher_pymethods[] = {
 #define METHNAME(name) gcmeth_##name
-  METH (encrypt,               "C.encrypt(PT) -> CT")
-  METH (enczero,               "C.enczero(N) -> CT")
-  METH (decrypt,               "C.decrypt(CT) -> PT")
-  METH (deczero,               "C.deczero(N) -> PT")
-  METH (setiv,                 "C.setiv(IV)")
-  METH (bdry,                  "C.bdry()")
+  METH (encrypt,       "C.encrypt(PT) -> CT")
+  METH (enczero,       "C.enczero(N) -> CT")
+  METH (decrypt,       "C.decrypt(CT) -> PT")
+  METH (deczero,       "C.deczero(N) -> PT")
+  METH (setiv,         "C.setiv(IV)")
+  METH (bdry,          "C.bdry()")
 #undef METHNAME
   { 0 }
 };
@@ -673,7 +673,7 @@ static PyTypeObject gccipher_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Symmetric cipher metaclass.",
+  "Symmetric cipher metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -721,7 +721,7 @@ static PyTypeObject gcipher_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Symmetric cipher, abstract base class.",
+  "Symmetric cipher, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -940,14 +940,14 @@ static PyObject *gcaeget_flags(PyObject *me, void *hunoz)
 
 static PyGetSetDef gcaead_pygetset[] = {
 #define GETSETNAME(op, name) gcae##op##_##name
-  GET  (keysz,                 "AEC.keysz -> acceptable key sizes")
-  GET  (noncesz,               "AEC.noncesz -> acceptable nonce sizes")
-  GET  (tagsz,                 "AEC.tagsz -> acceptable tag sizes")
-  GET  (blksz,                 "AEC.blksz -> block size, or zero")
-  GET  (bufsz,                 "AEC.bufsz -> amount of data buffered internally")
-  GET  (ohd,                   "AEC.ohd -> maximum encryption overhead")
-  GET  (name,                  "AEC.name -> name of this kind of AEAD scheme")
-  GET  (flags,                 "AEC.flags -> mask of `AEADF_...' flags")
+  GET  (keysz,         "AEC.keysz -> acceptable key sizes")
+  GET  (noncesz,       "AEC.noncesz -> acceptable nonce sizes")
+  GET  (tagsz,         "AEC.tagsz -> acceptable tag sizes")
+  GET  (blksz,         "AEC.blksz -> block size, or zero")
+  GET  (bufsz,         "AEC.bufsz -> amount of data buffered internally")
+  GET  (ohd,           "AEC.ohd -> maximum encryption overhead")
+  GET  (name,          "AEC.name -> name of this kind of AEAD scheme")
+  GET  (flags,         "AEC.flags -> mask of `AEADF_...' flags")
 #undef GETSETNAME
   { 0 }
 };
@@ -1044,9 +1044,9 @@ end:
 
 static PyMethodDef gaeadkey_pymethods[] = {
 #define METHNAME(name) gaekmeth_##name
-  METH  (aad,                  "KEY.aad() -> AAD")
-  KWMETH(enc,                  "KEY.enc(NONCE, [hsz], [msz], [tsz]) -> ENC")
-  KWMETH(dec,                  "KEY.dec(NONCE, [hsz], [csz], [tsz]) -> DEC")
+  METH (aad,           "KEY.aad() -> AAD")
+  KWMETH(enc,          "KEY.enc(NONCE, [hsz], [msz], [tsz]) -> ENC")
+  KWMETH(dec,          "KEY.dec(NONCE, [hsz], [csz], [tsz]) -> DEC")
 #undef METHNAME
   { 0 }
 };
@@ -1102,8 +1102,8 @@ static PyObject *gaeaget_hlen(PyObject *me, void *hunoz)
 
 static PyGetSetDef gaeadaad_pygetset[] = {
 #define GETSETNAME(op, name) gaea##op##_##name
-  GET  (hsz,                   "AAD.hsz -> precommitted header length or `None'")
-  GET  (hlen,                  "AAD.hlen -> header length so far")
+  GET  (hsz,           "AAD.hsz -> precommitted header length or `None'")
+  GET  (hlen,          "AAD.hlen -> header length so far")
 #undef GETSETNAME
   { 0 }
 };
@@ -1183,15 +1183,15 @@ static PyObject *gaeameth_hashstrz(PyObject *me, PyObject *arg)
 
 static PyMethodDef gaeadaad_pymethods[] = {
 #define METHNAME(name) gaeameth_##name
-  METH  (copy,                 "AAD.copy() -> AAD'")
-  METH  (hash,                 "AAD.hash(H)")
+  METH (copy,          "AAD.copy() -> AAD'")
+  METH (hash,          "AAD.hash(H)")
 #define METHU_(n, W, w) METH(hashu##w, "AAD.hashu" #w "(WORD)")
   DOUINTCONV(METHU_)
 #undef METHU_
 #define METHBUF_(n, W, w) METH(hashbuf##w, "AAD.hashbuf" #w "(BYTES)")
   DOUINTCONV(METHBUF_)
 #undef METHBUF_
-  METH  (hashstrz,             "AAD.hashstrz(STRING)")
+  METH (hashstrz,      "AAD.hashstrz(STRING)")
 #undef METHNAME
   { 0 }
 };
@@ -1239,10 +1239,10 @@ static PyObject *gaeeget_mlen(PyObject *me, void *hunoz)
 
 static PyGetSetDef gaeadenc_pygetset[] = {
 #define GETSETNAME(op, name) gaee##op##_##name
-  GET  (hsz,                   "ENC.hsz -> precommitted header length or `None'")
-  GET  (msz,                   "ENC.msz -> precommitted message length or `None'")
-  GET  (tsz,                   "ENC.tsz -> precommitted tag length or `None'")
-  GET  (mlen,                  "ENC.mlen -> message length so far")
+  GET  (hsz,           "ENC.hsz -> precommitted header length or `None'")
+  GET  (msz,           "ENC.msz -> precommitted message length or `None'")
+  GET  (tsz,           "ENC.tsz -> precommitted tag length or `None'")
+  GET  (mlen,          "ENC.mlen -> message length so far")
 #undef GETSETNAME
   { 0 }
 };
@@ -1364,10 +1364,10 @@ end:
 
 static PyMethodDef gaeadenc_pymethods[] = {
 #define METHNAME(name) gaeemeth_##name
-  METH  (aad,                  "ENC.aad() -> AAD")
-  KWMETH(reinit,               "ENC.reinit(NONCE, [hsz], [msz], [tsz])")
-  METH  (encrypt,              "ENC.encrypt(MSG) -> CT")
-  KWMETH(done,                 "ENC.done([tsz], [aad]) -> CT, TAG")
+  METH (aad,           "ENC.aad() -> AAD")
+  KWMETH(reinit,       "ENC.reinit(NONCE, [hsz], [msz], [tsz])")
+  METH (encrypt,       "ENC.encrypt(MSG) -> CT")
+  KWMETH(done,         "ENC.done([tsz], [aad]) -> CT, TAG")
 #undef METHNAME
   { 0 }
 };
@@ -1414,10 +1414,10 @@ static PyObject *gaedget_clen(PyObject *me, void *hunoz)
 
 static PyGetSetDef gaeaddec_pygetset[] = {
 #define GETSETNAME(op, name) gaed##op##_##name
-  GET  (hsz,                   "DEC.hsz -> precommitted header length or `None'")
-  GET  (csz,                   "DEC.csz -> precommitted ciphertext length or `None'")
-  GET  (tsz,                   "DEC.tsz -> precommitted tag length or `None'")
-  GET  (clen,                  "DEC.clen -> ciphertext length so far")
+  GET  (hsz,           "DEC.hsz -> precommitted header length or `None'")
+  GET  (csz,          "DEC.csz -> precommitted ciphertext length or `None'")
+  GET  (tsz,           "DEC.tsz -> precommitted tag length or `None'")
+  GET  (clen,          "DEC.clen -> ciphertext length so far")
 #undef GETSETNAME
   { 0 }
 };
@@ -1527,10 +1527,10 @@ end:
 
 static PyMethodDef gaeaddec_pymethods[] = {
 #define METHNAME(name) gaedmeth_##name
-  METH  (aad,                  "DEC.aad() -> AAD")
-  KWMETH(reinit,               "DEC.reinit(NONCE, [hsz], [csz], [tsz])")
-  METH  (decrypt,              "DEC.decrypt(CT) -> MSG")
-  KWMETH(done,                 "DEC.done(TAG, [aad]) -> MSG | None")
+  METH (aad,           "DEC.aad() -> AAD")
+  KWMETH(reinit,       "DEC.reinit(NONCE, [hsz], [csz], [tsz])")
+  METH (decrypt,       "DEC.decrypt(CT) -> MSG")
+  KWMETH(done,         "DEC.done(TAG, [aad]) -> MSG | None")
 #undef METHNAME
   { 0 }
 };
@@ -1560,7 +1560,7 @@ static PyTypeObject gcaead_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption (key) metaclass.",
+  "Authenticated encryption (key) metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1608,7 +1608,7 @@ static PyTypeObject gaeadkey_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption key.",
+  "Authenticated encryption key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1656,7 +1656,7 @@ static PyTypeObject gcaeadaad_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption additional-data hash metaclass.",
+  "Authenticated encryption additional-data hash metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1704,7 +1704,7 @@ static PyTypeObject gaeadaad_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption AAD hash.",
+  "Authenticated encryption AAD hash.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1752,7 +1752,7 @@ static PyTypeObject gcaeadenc_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption operation metaclass.",
+  "Authenticated encryption operation metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1800,7 +1800,7 @@ static PyTypeObject gaeadenc_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated encryption operation.",
+  "Authenticated encryption operation.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1848,7 +1848,7 @@ static PyTypeObject gcaeaddec_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated decryption operation metaclass.",
+  "Authenticated decryption operation metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1896,7 +1896,7 @@ static PyTypeObject gaeaddec_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Authenticated decryption operation.",
+  "Authenticated decryption operation.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2050,25 +2050,25 @@ static PyObject *ghmeth_done(PyObject *me, PyObject *arg)
 
 static PyGetSetDef gchash_pygetset[] = {
 #define GETSETNAME(op, name) gch##op##_##name
-  GET  (bufsz,                 "CH.bufsz -> hash buffer size, or zero")
-  GET  (hashsz,                "CH.hashsz -> hash output size")
-  GET  (name,                  "CH.name -> name of this kind of hash")
+  GET  (bufsz,         "CH.bufsz -> hash buffer size, or zero")
+  GET  (hashsz,        "CH.hashsz -> hash output size")
+  GET  (name,          "CH.name -> name of this kind of hash")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef ghash_pymethods[] = {
 #define METHNAME(name) ghmeth_##name
-  METH (copy,                  "H.copy() -> HH")
-  METH (hash,                  "H.hash(M)")
+  METH (copy,          "H.copy() -> HH")
+  METH (hash,          "H.hash(M)")
 #define METHU_(n, W, w) METH(hashu##w, "H.hashu" #w "(WORD)")
   DOUINTCONV(METHU_)
 #undef METHU_
 #define METHBUF_(n, W, w) METH(hashbuf##w, "H.hashbuf" #w "(BYTES)")
   DOUINTCONV(METHBUF_)
 #undef METHBUF_
-  METH (hashstrz,              "H.hashstrz(STRING)")
-  METH (done,                  "H.done() -> HASH")
+  METH (hashstrz,      "H.hashstrz(STRING)")
+  METH (done,          "H.done() -> HASH")
 #undef METHNAME
   { 0 }
 };
@@ -2098,7 +2098,7 @@ static PyTypeObject gchash_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Hash function metaclass.",
+  "Hash function metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2146,7 +2146,7 @@ static PyTypeObject ghash_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Hash function, abstract base class.",
+  "Hash function, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2280,9 +2280,9 @@ static PyObject *gcmget_tagsz(PyObject *me, void *hunoz)
 
 static PyGetSetDef gcmac_pygetset[] = {
 #define GETSETNAME(op, name) gcm##op##_##name
-  GET  (keysz,                 "CM.keysz -> acceptable key sizes")
-  GET  (tagsz,                 "CM.tagsz -> MAC output size")
-  GET  (name,                  "CM.name -> name of this kind of MAC")
+  GET  (keysz,         "CM.keysz -> acceptable key sizes")
+  GET  (tagsz,         "CM.tagsz -> MAC output size")
+  GET  (name,          "CM.name -> name of this kind of MAC")
 #undef GETSETNAME
   { 0 }
 };
@@ -2312,7 +2312,7 @@ static PyTypeObject gcmac_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Message authentication code metametaclass.",
+  "Message authentication code metametaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2360,7 +2360,7 @@ static PyTypeObject gmac_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Message authentication code metaclass, abstract base class.",
+  "Message authentication code metaclass, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2408,7 +2408,7 @@ static PyTypeObject gmhash_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Message authentication code, abstract base class.",
+  "Message authentication code, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2616,29 +2616,29 @@ end:
 
 static PyGetSetDef poly1305cls_pygetset[] = {
 #define GETSETNAME(op, name) poly1305cls##op##_##name
-  GET  (keysz,                 "PC.keysz -> acceptable key sizes")
-  GET  (masksz,                "PC.masksz -> mask size")
-  GET  (tagsz,                 "PC.tagsz -> MAC output size")
-  GET  (name,                  "PC.name -> name of this kind of MAC")
+  GET  (keysz,         "PC.keysz -> acceptable key sizes")
+  GET  (masksz,        "PC.masksz -> mask size")
+  GET  (tagsz,         "PC.tagsz -> MAC output size")
+  GET  (name,          "PC.name -> name of this kind of MAC")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef poly1305hash_pymethods[] = {
 #define METHNAME(name) polymeth_##name
-  METH  (copy,                 "P.copy() -> PP")
-  METH (hash,                  "P.hash(M)")
+  METH (copy,          "P.copy() -> PP")
+  METH (hash,          "P.hash(M)")
 #define METHU_(n, W, w) METH(hashu##w, "P.hashu" #w "(WORD)")
   DOUINTCONV(METHU_)
 #undef METHU_
 #define METHBUF_(n, W, w) METH(hashbuf##w, "P.hashbuf" #w "(BYTES)")
   DOUINTCONV(METHBUF_)
 #undef METHBUF_
-  METH (hashstrz,              "P.hashstrz(STRING)")
-  METH  (flush,                        "P.flush()")
-  METH  (flushzero,            "P.flushzero()")
-  METH  (concat,               "P.concat(PREFIX, SUFFIX)")
-  METH (done,                  "P.done() -> TAG")
+  METH (hashstrz,      "P.hashstrz(STRING)")
+  METH (flush,         "P.flush()")
+  METH (flushzero,     "P.flushzero()")
+  METH (concat,        "P.concat(PREFIX, SUFFIX)")
+  METH (done,          "P.done() -> TAG")
 #undef METHNAME
   { 0 }
 };
@@ -2668,7 +2668,7 @@ static PyTypeObject poly1305cls_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Poly1305 metametaclass.  Best not to ask.",
+  "Poly1305 metametaclass.  Best not to ask.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2716,7 +2716,7 @@ static PyTypeObject poly1305key_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"poly1305(K): Poly1305 key.",
+  "poly1305(K): Poly1305 key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2764,7 +2764,7 @@ static PyTypeObject poly1305hash_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Poly1305 MAC context base class.",
+  "Poly1305 MAC context base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2927,17 +2927,17 @@ end:
 
 static PyGetSetDef kxvik_pygetset[] = {
 #define GETSETNAME(op, name) kxvik##op##_##name
-  GETSET(nround,               "KECCAK.nround -> number of rounds")
+  GETSET(nround,       "KECCAK.nround -> number of rounds")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef kxvik_pymethods[] = {
 #define METHNAME(func) kxvikmeth_##func
-  METH (copy,                  "KECCAK.copy() -> KECCAK'")
-  METH (mix,                   "KECCAK.mix(DATA)")
-  METH (extract,               "KECCAK.extract(NOCTETS)")
-  METH (step,                  "KECCAK.step()")
+  METH (copy,          "KECCAK.copy() -> KECCAK'")
+  METH (mix,           "KECCAK.mix(DATA)")
+  METH (extract,       "KECCAK.extract(NOCTETS)")
+  METH (step,          "KECCAK.step()")
 #undef METHNAME
   { 0 }
 };
@@ -2967,7 +2967,7 @@ static PyTypeObject kxvik_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Keccak1600([nround = 24]): Keccak-p[1600, n] state.",
+  "Keccak1600([nround = 24]): Keccak-p[1600, n] state.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3163,28 +3163,28 @@ static PyObject *shakeget_state(PyObject *me, void *hunoz)
 
 static PyGetSetDef shake_pygetset[] = {
 #define GETSETNAME(op, name) shake##op##_##name
-  GET  (rate,                  "S.rate -> rate, in bytes")
-  GET  (buffered,              "S.buffered -> amount currently buffered")
-  GET  (state,                 "S.state -> `absorb', `squeeze', `dead'")
+  GET  (rate,          "S.rate -> rate, in bytes")
+  GET  (buffered,      "S.buffered -> amount currently buffered")
+  GET  (state,         "S.state -> `absorb', `squeeze', `dead'")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef shake_pymethods[] = {
 #define METHNAME(func) shakemeth_##func
-  METH  (copy,                 "S.copy() -> SS")
-  METH (hash,                  "S.hash(M)")
+  METH (copy,          "S.copy() -> SS")
+  METH (hash,          "S.hash(M)")
 #define METHU_(n, W, w) METH(hashu##w, "S.hashu" #w "(WORD)")
   DOUINTCONV(METHU_)
 #undef METHU_
 #define METHBUF_(n, W, w) METH(hashbuf##w, "S.hashbuf" #w "(BYTES)")
   DOUINTCONV(METHBUF_)
 #undef METHBUF_
-  METH (hashstrz,              "S.hashstrz(STRING)")
-  METH (xof,                   "S.xof()")
-  METH (done,                  "S.done(LEN) ->H")
-  METH (get,                   "S.get(LEN) -> H")
-  METH (mask,                  "S.mask(M) -> C")
+  METH (hashstrz,      "S.hashstrz(STRING)")
+  METH (xof,           "S.xof()")
+  METH (done,          "S.done(LEN) -> H")
+  METH (get,           "S.get(LEN) -> H")
+  METH (mask,          "S.mask(M) -> C")
 #undef METHNAME
   { 0 }
 };
@@ -3214,7 +3214,7 @@ static PyTypeObject shake_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"SHAKE/cSHAKE base class.",
+  "SHAKE/cSHAKE/KMAC base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3262,7 +3262,7 @@ static PyTypeObject shake128_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Shake128([perso = STR], [func = STR]): SHAKE128/cSHAKE128 XOF.",
+  "Shake128([perso = STR], [func = STR]): SHAKE128/cSHAKE128 XOF.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3310,7 +3310,7 @@ static PyTypeObject shake256_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Shake256([perso = STR], [func = STR]): SHAKE256/cSHAKE256 XOF.",
+  "Shake256([perso = STR], [func = STR]): SHAKE256/cSHAKE256 XOF.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3467,17 +3467,17 @@ end:
 
 static PyGetSetDef gcprp_pygetset[] = {
 #define GETSETNAME(op, name) gcp##op##_##name
-  GET  (keysz,                 "CP.keysz -> acceptable key sizes")
-  GET  (blksz,                 "CP.blksz -> block size")
-  GET  (name,                  "CP.name -> name of this kind of PRP")
+  GET  (keysz,         "CP.keysz -> acceptable key sizes")
+  GET  (blksz,         "CP.blksz -> block size")
+  GET  (name,          "CP.name -> name of this kind of PRP")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef gprp_pymethods[] = {
 #define METHNAME(name) gpmeth_##name
-  METH (encrypt,               "P.encrypt(PT) -> CT")
-  METH (decrypt,               "P.decrypt(CT) -> PT")
+  METH (encrypt,       "P.encrypt(PT) -> CT")
+  METH (decrypt,       "P.decrypt(CT) -> PT")
 #undef METHNAME
   { 0 }
 };
@@ -3507,7 +3507,7 @@ static PyTypeObject gcprp_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Pseudorandom permutation metaclass.",
+  "Pseudorandom permutation metaclass.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3555,7 +3555,7 @@ static PyTypeObject gprp_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Pseudorandom permutation, abstract base class.",
+  "Pseudorandom permutation, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -3582,26 +3582,26 @@ static PyTypeObject gprp_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_KeySZ_fromdl,         "\
-fromdl(N) -> M: convert integer discrete log field size to work factor")
-  METH (_KeySZ_fromschnorr,    "\
-fromschnorr(N) -> M: convert Schnorr group order to work factor")
-  METH (_KeySZ_fromif,         "\
-fromif(N) -> M: convert integer factorization problem size to work factor")
-  METH (_KeySZ_fromec,         "\
-fromec(N) -> M: convert elliptic curve group order to work factor")
-  METH (_KeySZ_todl,           "\
-todl(N) -> M: convert work factor to integer discrete log field size")
-  METH (_KeySZ_toschnorr,      "\
-toschnorr(N) -> M: convert work factor to Schnorr group order")
-  METH (_KeySZ_toif,           "\
-toif(N) -> M: convert work factor to integer factorization problem size")
-  METH (_KeySZ_toec,           "\
-toec(N) -> M: convert work factor to elliptic curve group order")
-  METH (_KeySZ_toec,           "\
-toec(N) -> M: convert work factor to elliptic curve group order")
-#define METH_HDANCE(hdance, HDance) METH(hdance##_prf, "\
-" #hdance "_prf(K, N) -> H: calculate " HDance " hash of N with K")
+  METH (_KeySZ_fromdl, "fromdl(N) -> M: "
+                   "convert integer discrete log field size to work factor")
+  METH (_KeySZ_fromschnorr, "fromschnorr(N) -> M: "
+                               "convert Schnorr group order to work factor")
+  METH (_KeySZ_fromif, "fromif(N) -> M: "
+                "convert integer factorization problem size to work factor")
+  METH (_KeySZ_fromec, "fromec(N) -> M: "
+                        "convert elliptic curve group order to work factor")
+  METH (_KeySZ_todl,   "todl(N) -> M: "
+                   "convert work factor to integer discrete log field size")
+  METH (_KeySZ_toschnorr, "toschnorr(N) -> M: "
+                               "convert work factor to Schnorr group order")
+  METH (_KeySZ_toif,   "toif(N) -> M: "
+                "convert work factor to integer factorization problem size")
+  METH (_KeySZ_toec,   "toec(N) -> M: "
+                        "convert work factor to elliptic curve group order")
+  METH (_KeySZ_toec,   "toec(N) -> M: "
+                        "convert work factor to elliptic curve group order")
+#define METH_HDANCE(hdance, HDance) METH(hdance##_prf,                 \
+        "" #hdance "_prf(K, N) -> H: calculate " HDance " hash of N with K")
   METH_HDANCE(hsalsa20, "HSalsa20")
   METH_HDANCE(hsalsa2012, "HSalsa20/12")
   METH_HDANCE(hsalsa208, "HSalsa20/8")
index 45888ec12cf0f7135b261bd08f539ebf29c23623..43ed43dcd204e7c3a44746633d36b7d96310ee68 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -247,33 +247,33 @@ end:
 
 static PyGetSetDef rbuf_pygetset[] = {
 #define GETSETNAME(op, name) rb##op##_##name
-  GET  (size,                  "RBUF.size -> SIZE")
-  GET  (left,                  "RBUF.left -> REMAINDER")
-  GET  (endp,                  "RBUF.endp -> BOOL")
-  GETSET(offset,               "RBUF.offset -> OFFSET")
+  GET  (size,          "RBUF.size -> SIZE")
+  GET  (left,          "RBUF.left -> REMAINDER")
+  GET  (endp,          "RBUF.endp -> BOOL")
+  GETSET(offset,       "RBUF.offset -> OFFSET")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef rbuf_pymethods[] = {
 #define METHNAME(func) rbmeth_##func
-  METH (skip,                  "RBUF.skip(N)")
-  METH (get,                   "RBUF.get(N) -> BYTES")
+  METH (skip,          "RBUF.skip(N)")
+  METH (get,           "RBUF.get(N) -> BYTES")
 #define RBMETH_DECL_GETU_(n, W, w)                                     \
-    METH(getu##w, "RBUF.getu" #w "() -> INT")
+    METH(getu##w,      "RBUF.getu" #w "() -> INT")
   DOUINTCONV(RBMETH_DECL_GETU_)
 #define RBMETH_DECL_GETBLK_(n, W, w)                                   \
-    METH(getblk##w, "RBUF.getblk" #w "() -> BYTES")
+    METH(getblk##w,    "RBUF.getblk" #w "() -> BYTES")
   BUF_DOSUFFIXES(RBMETH_DECL_GETBLK_)
 #define RBMETH_DECL_GETBUF_(n, W, w)                                   \
-    METH(getbuf##w, "RBUF.getbuf" #w "() -> RBUF'")
+    METH(getbuf##w,    "RBUF.getbuf" #w "() -> RBUF'")
   BUF_DOSUFFIXES(RBMETH_DECL_GETBUF_)
-  METH (getmp,                 "RBUF.getmp() -> X")
-  METH (getgf,                 "RBUF.getgf() -> X")
-  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 (getmp,         "RBUF.getmp() -> X")
+  METH (getgf,         "RBUF.getgf() -> X")
+  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")
 #undef METHNAME
   { 0 }
 };
@@ -310,7 +310,7 @@ static PyTypeObject rbuf_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ReadBuffer(STR): a read buffer.",
+  "ReadBuffer(STR): a read buffer.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -492,28 +492,28 @@ static PyObject *wbget_contents(PyObject *me, void *hunoz)
 
 static PyGetSetDef wbuf_pygetset[] = {
 #define GETSETNAME(op, name) wb##op##_##name
-  GET  (size,                  "WBUF.size -> SIZE")
-  GET  (contents,              "WBUF.contents -> STR")
+  GET  (size,          "WBUF.size -> SIZE")
+  GET  (contents,      "WBUF.contents -> STR")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef wbuf_pymethods[] = {
 #define METHNAME(func) wbmeth_##func
-  METH (zero,                  "WBUF.zero(N)")
-  METH (put,                   "WBUF.put(BYTES)")
+  METH (zero,          "WBUF.zero(N)")
+  METH (put,           "WBUF.put(BYTES)")
 #define WBMETH_DECL_PUTU_(n, W, w)                                     \
-    METH(putu##w, "WBUF.putu" #w "(INT)")
+    METH(putu##w,      "WBUF.putu" #w "(INT)")
   DOUINTCONV(WBMETH_DECL_PUTU_)
 #define WBMETH_DECL_PUTBLK_(n, W, w)                                   \
-    METH(putblk##w, "WBUF.putblk" #w "(BYTES)")
+    METH(putblk##w,    "WBUF.putblk" #w "(BYTES)")
   BUF_DOSUFFIXES(WBMETH_DECL_PUTBLK_)
-  METH (putmp,                 "WBUF.putmp(X)")
-  METH (putgf,                 "WBUF.putgf(X)")
-  METH (putecpt,               "WBUF.putecpt(P)")
-  METH (putecptraw,            "WBUF.putecptraw(P)")
-  METH (putge,                 "WBUF.putge(X)")
-  METH (putgeraw,              "WBUF.putgeraw(X)")
+  METH (putmp,         "WBUF.putmp(X)")
+  METH (putgf,         "WBUF.putgf(X)")
+  METH (putecpt,       "WBUF.putecpt(P)")
+  METH (putecptraw,    "WBUF.putecptraw(P)")
+  METH (putge,         "WBUF.putge(X)")
+  METH (putgeraw,      "WBUF.putgeraw(X)")
 #undef METHNAME
   { 0 }
 };
@@ -550,7 +550,7 @@ static PyTypeObject wbuf_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"WriteBuffer([size = ?]): a write buffer.",
+  "WriteBuffer([size = ?]): a write buffer.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
index 0a3e14a11bde461a82cef66534ccddaf168c4d8d..eef8ed14f5a87396d03ef9577f7c68b67fec13ff 100644 (file)
@@ -336,7 +336,7 @@ static PyTypeObject bytestring_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ByteString(STR): byte string class.",
+  "ByteString(STR): byte string class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -363,8 +363,8 @@ static PyTypeObject bytestring_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH  (ctstreq,              "ctstreq(S, T) -> BOOL")
-  METH (_ByteString_zero,      "zero(N) -> 0000...00")
+  METH (ctstreq,       "ctstreq(S, T) -> BOOL")
+  METH (_ByteString_zero, "zero(N) -> 0000...00")
 #undef METHNAME
   { 0 }
 };
index f02d39e428da0eaaaf82161958533197fb81e00f..bb0bbdbcec1d8f7e6154a206c78b127184ad6a41 100644 (file)
@@ -151,7 +151,7 @@ static PyObject *meth__ego(PyObject *me, PyObject *arg)
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_ego,                  "_ego(ARGV0)")
+  METH (_ego,          "_ego(ARGV0)")
 #undef METHNAME
   { 0 }
 };
diff --git a/ec.c b/ec.c
index 9034c5e2159382fc190eb2ca2b48876ed213dc84..edf6ed64ba24638033963c4e3d5f4e23cf21df10 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -640,9 +640,9 @@ static PyTypeObject ecpt_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"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.",
+  "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@ */
@@ -757,7 +757,7 @@ static PyTypeObject ecptcurve_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Elliptic curve points; abstract base class for points on given curves.",
+  "Elliptic curve points; abstract base class for points on given curves.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1063,8 +1063,7 @@ static PyGetSetDef eccurve_pygetset[] = {
 
 static PyMethodDef eccurve_pymethods[] = {
 #define METHNAME(name) ecmeth_##name
-  METH (mmul,          "\
-E.mmul([(P0, N0), (P1, N1), ...]) = N0 P0 + N1 P1 + ...")
+  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")
 #undef METHNAME
@@ -1096,7 +1095,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@ */
@@ -1150,8 +1149,8 @@ static PyTypeObject ecprimecurve_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECPrimeCurve(FIELD, A, B): an elliptic curve over a prime field.\n\
-  Use ECPrimeProjCurve instead.",
+  "ECPrimeCurve(FIELD, A, B): an elliptic curve over a prime field.\n"
+  "  Use ECPrimeProjCurve instead.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1205,8 +1204,8 @@ static PyTypeObject ecprimeprojcurve_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECPrimeProjCurve(FIELD, A, B): an elliptic curve over a prime field\n\
-  using projective coordinates.",
+  "ECPrimeProjCurve(FIELD, A, B): an elliptic curve over a prime field\n"
+  "  using projective coordinates.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1260,8 +1259,8 @@ static PyTypeObject ecbincurve_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECBinCurve(FIELD, A, B): an elliptic curve over a binary field.\n\
-  Use ECBinProjCurve instead.",
+  "ECBinCurve(FIELD, A, B): an elliptic curve over a binary field.\n"
+  "  Use ECBinProjCurve instead.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1315,8 +1314,8 @@ static PyTypeObject ecbinprojcurve_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECBinProjCurve(FIELD, A, B): an elliptic curve over a binary field,\n\
-  using projective coordinates.",
+  "ECBinProjCurve(FIELD, A, B): an elliptic curve over a binary field,\n"
+  "  using projective coordinates.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1521,7 +1520,7 @@ static PyTypeObject ecinfo_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECInfo(CURVE, G, R, H): elliptic curve domain parameters.",
+  "ECInfo(CURVE, G, R, H): elliptic curve domain parameters.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1548,13 +1547,13 @@ static PyTypeObject ecinfo_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_ECPt_frombuf,         "frombuf(E, STR) -> (P, REST)")
-  METH (_ECPtCurve_fromraw,    "fromraw(E, STR) -> (P, REST)")
-  KWMETH(_ECPtCurve_os2ecp,    "os2ecp(E, STR, [flags = ...]) -> (P, REST)")
-  METH (_ECPt_parse,           "parse(E, STR) -> (P, REST)")
-  METH (_ECCurve_parse,        "parse(STR) -> (E, REST)")
-  METH (_ECInfo_parse,         "parse(STR) -> (I, REST)")
-  METH (_ECInfo__curven,       "_curven(N) -> I")
+  METH (_ECPt_frombuf, "frombuf(E, STR) -> (P, REST)")
+  METH (_ECPtCurve_fromraw, "fromraw(E, STR) -> (P, REST)")
+  KWMETH(_ECPtCurve_os2ecp, "os2ecp(E, STR, [flags = ...]) -> (P, REST)")
+  METH (_ECPt_parse,   "parse(E, STR) -> (P, REST)")
+  METH (_ECCurve_parse, "parse(STR) -> (E, REST)")
+  METH (_ECInfo_parse, "parse(STR) -> (I, REST)")
+  METH (_ECInfo__curven, "_curven(N) -> I")
 #undef METHNAME
   { 0 }
 };
diff --git a/field.c b/field.c
index e5f5eca2d02271aaad7583863601c2ff11daef82..e33fdfdf51ce548f68cad8263597cb294d52ceb2 100644 (file)
--- a/field.c
+++ b/field.c
@@ -416,7 +416,7 @@ static PyTypeObject fe_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Finite field elements, abstract base class.",
+  "Finite field elements, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -545,7 +545,7 @@ static PyTypeObject field_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"An abstract field.  This is an abstract type.",
+  "An abstract field.  This is an abstract type.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -623,7 +623,7 @@ static PyTypeObject primefield_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeField(P): prime fields.",
+  "PrimeField(P): prime fields.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -690,7 +690,7 @@ static PyTypeObject niceprimefield_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"NicePrimeField(P): prime field using Solinas reduction.",
+  "NicePrimeField(P): prime field using Solinas reduction.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -754,7 +754,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@ */
@@ -820,7 +820,7 @@ static PyTypeObject binpolyfield_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BinPolyField(P): binary fields with polynomial basis representation.",
+  "BinPolyField(P): binary fields with polynomial basis representation.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -899,7 +899,7 @@ static PyTypeObject binnormfield_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BinNormField(P, BETA): binary fields with normal basis representation.",
+  "BinNormField(P, BETA): binary fields with normal basis representation.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -944,7 +944,7 @@ end:
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_Field_parse,          "parse(STR) -> F, REST")
+  METH (_Field_parse,  "parse(STR) -> F, REST")
 #undef METHNAME
   { 0 }
 };
diff --git a/group.c b/group.c
index 5d7c34bac73f44ed6944c9dfc4d564322aac1dff..3a4b05bbf4d5de6a388c6648a72c49d0730ec600 100644 (file)
--- a/group.c
+++ b/group.c
@@ -297,24 +297,24 @@ static PyObject *meth__BinDHInfo_parse(PyObject *me, PyObject *arg)
 
 static PyGetSetDef fginfo_pygetset[] = {
 #define GETSETNAME(op, name) fi##op##_##name
-  GET  (r,                     "I.r -> group order")
+  GET  (r,             "I.r -> group order")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyGetSetDef dhinfo_pygetset[] = {
 #define GETSETNAME(op, name) di##op##_##name
-  GET  (p,                     "I.p -> prime")
-  GET  (g,                     "I.g -> generator")
+  GET  (p,             "I.p -> prime")
+  GET  (g,             "I.g -> generator")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyGetSetDef bindhinfo_pygetset[] = {
 #define GETSETNAME(op, name) bi##op##_##name
-  GET  (p,                     "I.p -> irreducible polynomial")
-  GET  (m,                     "I.m -> degree of polynomial")
-  GET  (g,                     "I.g -> generator")
+  GET  (p,             "I.p -> irreducible polynomial")
+  GET  (m,             "I.m -> degree of polynomial")
+  GET  (g,             "I.g -> generator")
 #undef GETSETNAME
   { 0 }
 };
@@ -344,7 +344,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@ */
@@ -392,7 +392,7 @@ static PyTypeObject dhinfo_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"DHInfo(P, R, G): standard (integer) Diffie-Hellman group information.",
+  "DHInfo(P, R, G): standard (integer) Diffie-Hellman group information.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -440,7 +440,7 @@ static PyTypeObject bindhinfo_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BinDHInfo(P, R, G): binary-field Diffie-Hellman group information.",
+  "BinDHInfo(P, R, G): binary-field Diffie-Hellman group information.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -982,8 +982,8 @@ static PyMethodDef ge_pymethods[] = {
   METH (sqr,           "X.sqr() -> X^2 = X * X")
   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")
+  KWMETH(toec,         "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
@@ -1059,7 +1059,7 @@ static PyTypeObject ge_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Group elements, abstract base class.",
+  "Group elements, abstract base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1096,8 +1096,7 @@ static PyGetSetDef group_pygetset[] = {
 
 static PyMethodDef group_pymethods[] = {
 #define METHNAME(name) gmeth_##name
-  METH (mexp,          "\
-G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
+  METH (mexp,        "G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
   KWMETH(checkgroup,   "G.checkgroup([rng = rand]): check group is good")
 #undef METHNAME
   { 0 }
@@ -1128,7 +1127,7 @@ static PyTypeObject group_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Abstract base class for groups.",
+  "Abstract base class for groups.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1205,7 +1204,7 @@ static PyTypeObject primegroup_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeGroup(INFO): subgroups of prime fields.",
+  "PrimeGroup(INFO): subgroups of prime fields.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1282,7 +1281,7 @@ static PyTypeObject bingroup_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BinGroup(INFO): subgroups of binary fields.",
+  "BinGroup(INFO): subgroups of binary fields.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1360,7 +1359,7 @@ static PyTypeObject ecgroup_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ECGroup(INFO): elliptic curve groups.",
+  "ECGroup(INFO): elliptic curve groups.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1387,26 +1386,29 @@ static PyTypeObject ecgroup_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(name) meth_##name
-  METH (_GE_frombuf,           "frombuf(BUF) -> X, REST")
-  METH (_GE_fromraw,           "fromraw(BUF) -> X, REST")
-  METH (_GE_fromstring,        "fromstring(STR) -> X, REST")
-  METH (_Group_parse,          "parse(STR) -> G, REST")
-  METH (_DHInfo_parse,         "parse(STR) -> D, REST")
-  METH (_BinDHInfo_parse,      "parse(STR) -> D, REST")
-  METH (_DHInfo__groupn,       0)
-  METH (_BinDHInfo__groupn,    0)
-  KWMETH(_DHInfo_generate,     "\
-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, ...])")
-  KWMETH(_DHInfo_gendsa,       "\
-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\
-  -> (D, V)")
+  METH (_GE_frombuf,   "frombuf(BUF) -> X, REST")
+  METH (_GE_fromraw,   "fromraw(BUF) -> X, REST")
+  METH (_GE_fromstring, "fromstring(STR) -> X, REST")
+  METH (_Group_parse,  "parse(STR) -> G, REST")
+  METH (_DHInfo_parse, "parse(STR) -> D, REST")
+  METH (_BinDHInfo_parse, "parse(STR) -> D, REST")
+  METH (_DHInfo__groupn, 0)
+  METH (_BinDHInfo__groupn, 0)
+  KWMETH(_DHInfo_generate,
+       "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, ...])")
+  KWMETH(_DHInfo_gendsa,
+       "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"
+       "  -> (D, V)")
 #undef METHNAME
   { 0 }
 };
diff --git a/key.c b/key.c
index b51c4567f44392d33d747eb36c11a36c5bb4e603..634eb290a427c7ddf25302d5a8784da2076b85a6 100644 (file)
--- a/key.c
+++ b/key.c
@@ -98,8 +98,8 @@ done:
 
 static PyMethodDef keyexc_pymethods[] = {
 #define METHNAME(func) kxmeth_##func
-  METH (__init__,              "KeyError(CODE)")
-  METH (__str__,               "E.__str__() -> STRING")
+  METH (__init__,      "KeyError(CODE)")
+  METH (__str__,       "E.__str__() -> STRING")
 #undef METHNAME
   { 0 }
 };
@@ -465,20 +465,20 @@ static PyObject *kdget_flags(PyObject *me, void *hunoz)
 
 static PyMethodDef keydata_pymethods[] = {
 #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")
-  METH (plock,                 "KD.plock(TAG) -> ENCRYPTED-KD")
-  METH (lock,                  "KD.lock(KEY) -> ENCRYPTED-KD")
+  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")
+  METH (plock,         "KD.plock(TAG) -> ENCRYPTED-KD")
+  METH (lock,          "KD.lock(KEY) -> ENCRYPTED-KD")
 #undef METHNAME
   { 0 }
 };
 
 static PyGetSetDef keydata_pygetset[] = {
 #define GETSETNAME(op, name) kd##op##_##name
-  GET  (flags,                 "KD.flags -> FLAGS")
+  GET  (flags,         "KD.flags -> FLAGS")
 #undef GETSETNAME
   { 0 }
 };
@@ -508,7 +508,7 @@ static PyTypeObject keydata_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Key data base class.",
+  "Key data base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -555,7 +555,7 @@ static PyObject *kdbget_bin(PyObject *me, void *hunoz)
 
 static PyGetSetDef keydatabin_pygetset[] = {
 #define GETSETNAME(op, name) kdb##op##_##name
-  GET  (bin,                   "KD.bin -> BYTES")
+  GET  (bin,           "KD.bin -> BYTES")
 #undef GETSETNAME
   { 0 }
 };
@@ -585,7 +585,7 @@ static PyTypeObject keydatabin_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataBinary(KEY, [flags = 0]): key data for binary keys.",
+  "KeyDataBinary(KEY, [flags = 0]): key data for binary keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -682,17 +682,17 @@ end:
 
 static PyMethodDef keydataenc_pymethods[] = {
 #define METHNAME(func) kdemeth_##func
-  METH (plock,                 "KD.plock(TAG) -> ENCRYPTED-KD")
-  METH (lock,                  "KD.lock(KEY) -> ENCRYPTED-KD")
-  METH (punlock,               "KD.punlock(TAG) -> KD")
-  METH (unlock,                "KD.unlock(KEY) -> KD")
+  METH (plock,         "KD.plock(TAG) -> ENCRYPTED-KD")
+  METH (lock,          "KD.lock(KEY) -> ENCRYPTED-KD")
+  METH (punlock,       "KD.punlock(TAG) -> KD")
+  METH (unlock,        "KD.unlock(KEY) -> KD")
 #undef METHNAME
   { 0 }
 };
 
 static PyGetSetDef keydataenc_pygetset[] = {
 #define GETSETNAME(op, name) kde##op##_##name
-  GET  (ct,                    "KD.ct -> BYTES")
+  GET  (ct,            "KD.ct -> BYTES")
 #undef GETSETNAME
   { 0 }
 };
@@ -722,7 +722,7 @@ static PyTypeObject keydataenc_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataEncrypted(KEY, [flags = 0]): key data for encrypted keys.",
+  "KeyDataEncrypted(KEY, [flags = 0]): key data for encrypted keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -768,7 +768,7 @@ static PyObject *kdmget_mp(PyObject *me, void *hunoz)
 
 static PyGetSetDef keydatamp_pygetset[] = {
 #define GETSETNAME(op, name) kdm##op##_##name
-  GET  (mp,                    "KD.mp -> X")
+  GET  (mp,            "KD.mp -> X")
 #undef GETSETNAME
   { 0 }
 };
@@ -798,7 +798,7 @@ static PyTypeObject keydatamp_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataMP(KEY, [flags = 0]): key data for large-integer keys.",
+  "KeyDataMP(KEY, [flags = 0]): key data for large-integer keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -843,7 +843,7 @@ static PyObject *kdsget_str(PyObject *me, void *hunoz)
 
 static PyGetSetDef keydatastr_pygetset[] = {
 #define GETSETNAME(op, name) kds##op##_##name
-  GET  (str,                   "KD.str -> STRING")
+  GET  (str,           "KD.str -> STRING")
 #undef GETSETNAME
   { 0 }
 };
@@ -873,7 +873,7 @@ static PyTypeObject keydatastr_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataString(KEY, [flags = 0]): key data for string keys.",
+  "KeyDataString(KEY, [flags = 0]): key data for string keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -923,7 +923,7 @@ static PyObject *kdeget_ecpt(PyObject *me, void *hunoz)
 
 static PyGetSetDef keydataec_pygetset[] = {
 #define GETSETNAME(op, name) kde##op##_##name
-  GET  (ecpt,                  "KD.ecpt -> ECPT")
+  GET  (ecpt,          "KD.ecpt -> ECPT")
 #undef GETSETNAME
   { 0 }
 };
@@ -953,7 +953,7 @@ static PyTypeObject keydataec_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataECPt(KEY, [flags = 0]): key data for elliptic-curve keys.",
+  "KeyDataECPt(KEY, [flags = 0]): key data for elliptic-curve keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1024,7 +1024,7 @@ static PyTypeObject subkeyiter_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Iterator for structured keys.",
+  "Iterator for structured keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1159,7 +1159,7 @@ static PyTypeObject keydatastruct_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyDataStructured([subkeys = []]): key data for structured keys.",
+  "KeyDataStructured([subkeys = []]): key data for structured keys.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1235,7 +1235,7 @@ static PyTypeObject keyattriter_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Iterator for key attributes.",
+  "Iterator for key attributes.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1345,7 +1345,7 @@ static PyTypeObject keyattrs_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Proxy thing for talking about key attributes.",
+  "Proxy thing for talking about key attributes.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1650,7 +1650,7 @@ static PyTypeObject key_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Key(KF, ID, TYPE, [exptime = KEXP_FOREVER]): key object.",
+  "Key(KF, ID, TYPE, [exptime = KEXP_FOREVER]): key object.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1724,7 +1724,7 @@ static PyTypeObject keyiter_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Keyring iterator.",
+  "Keyring iterator.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1994,8 +1994,8 @@ 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(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")
@@ -2046,8 +2046,8 @@ static PyTypeObject keyfile_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KeyFile(FILE, [how = KOPEN_READ], [report = ?]): Keyring file.\n\
-   calls REPORT(FILE, LINE, MSG) on problems",
+  "KeyFile(FILE, [how = KOPEN_READ], [report = ?]): Keyring file.\n"
+  "   calls REPORT(FILE, LINE, MSG) on problems",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2074,11 +2074,11 @@ static PyTypeObject keyfile_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_KeyData_readflags,
-          "KeyData.readflags(STRING) -> (FLAGS, MASK, REST)")
-  METH (_KeyData_writeflags,   "KeyData.writeflags(FLAGS) -> STRING")
-  METH (_KeyData_read,         "KeyData.read(STRING) -> (KD, REST)")
-  METH (_KeyData_decode,       "KeyData.decode(BYTES) -> KD")
+  METH (_KeyData_readflags, "KeyData.readflags(STRING) "
+                                                   "-> (FLAGS, MASK, REST)")
+  METH (_KeyData_writeflags, "KeyData.writeflags(FLAGS) -> STRING")
+  METH (_KeyData_read, "KeyData.read(STRING) -> (KD, REST)")
+  METH (_KeyData_decode, "KeyData.decode(BYTES) -> KD")
 #undef METHNAME
   { 0 }
 };
diff --git a/mp.c b/mp.c
index f29474ab06fd6815b16db78e818b34c739c8c834..ad68e037a7ca06b4967f51751fa3723725c0e374 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -804,20 +804,20 @@ static PyMethodDef mp_pymethods[] = {
   METH (sqr,           "X.sqr() -> X^2")
   METH (sqrt,          "X.sqrt() -> largest integer <= sqrt(X)")
   METH (gcd,           "X.gcd(Y) -> gcd(X, Y)")
-  METH (gcdx,
-        "X.gcdx(Y) -> (gcd(X, Y), U, V) with X U + Y V = gcd(X, Y)")
+  METH (gcdx,          "X.gcdx(Y) -> (gcd(X, Y), U, V) "
+                                               "with X U + Y V = gcd(X, Y)")
   METH (modinv,        "X.modinv(Y) -> multiplicative inverse of Y mod X")
   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)")
+  METH (leastcongruent, "X.leastcongruent(B, M) -> "
+                                      "smallest Z >= B with Z == X (mod M)")
   KWMETH(primep,       "X.primep([rng = rand]) -> 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")
-  KWMETH(storeb2c,
-        "X.storeb2c([len = -1]) -> big-endian bytes, two's complement")
+  KWMETH(storel2c,     "X.storel2c([len = -1]) -> "
+                                    "little-endian bytes, two's complement")
+  KWMETH(storeb2c,     "X.storeb2c([len = -1]) -> "
+                                       "big-endian bytes, two's complement")
   METH (tobuf,         "X.tobuf() -> buffer format")
 #undef METHNAME
   { 0 }
@@ -892,20 +892,20 @@ static PyTypeObject mp_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Multiprecision integers, similar to `long' but more efficient and\n\
-versatile.  Support all the standard arithmetic operations, with\n\
-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\
-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\
-with an integer conversion.\n\
-\n\
-Notes:\n\
-\n\
-  * Use `//' for integer division: `/' gives exact rational division.",
+  "Multiprecision integers, similar to `long' but more efficient and\n"
+  "versatile.  Support all the standard arithmetic operations, with\n"
+  "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"
+  "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"
+  "with an integer conversion.\n"
+  "\n"
+  "Notes:\n"
+  "\n"
+  "  * Use `//' for integer division: `/' gives exact rational division.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1070,15 +1070,15 @@ static PyObject *mmget_livep(PyObject *me, void *hunoz)
 
 static PyGetSetDef mpmul_pygetset[] = {
 #define GETSETNAME(op, name) mm##op##_##name
-  GET  (livep,                 "MM.livep -> flag: object still valid?")
+  GET  (livep,         "MM.livep -> flag: object still valid?")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef mpmul_pymethods[] = {
 #define METHNAME(name) mmmeth_##name
-  METH (factor,                "MM.factor(ITERABLE) or MM.factor(I, ...)")
-  METH (done,                  "MM.done() -> PRODUCT")
+  METH (factor,        "MM.factor(ITERABLE) or MM.factor(I, ...)")
+  METH (done,          "MM.done() -> PRODUCT")
 #undef METHNAME
   { 0 }
 };
@@ -1108,7 +1108,7 @@ static PyTypeObject *mpmul_pytype, mpmul_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"MPMul(N_0, N_1, ....): 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@ */
@@ -1337,15 +1337,15 @@ static PyMethodDef mpmont_pymethods[] = {
   METH (int,           "M.int(X) -> XR")
   METH (mul,           "M.mul(XR, YR) -> ZR where Z = X Y")
   METH (expr,          "M.expr(XR, N) -> ZR where Z = X^N mod M.m")
-  METH (mexpr,         "\
-M.mexpr([(XR0, N0), (XR1, N1), ...]) = ZR where Z = X0^N0 X1^N1 ... mod M.m\n\
-\t(the list may be flattened if this more convenient.)")
+  METH (mexpr,         "M.mexpr([(XR0, N0), (XR1, N1), ...]) = ZR "
+                                       "where Z = X0^N0 X1^N1 ... mod M.m\n"
+                   "\t(the list may be flattened if this more convenient.)")
   METH (reduce,        "M.reduce(XR) -> X")
   METH (ext,           "M.ext(XR) -> X")
   METH (exp,           "M.exp(X, N) -> X^N mod M.m")
-  METH (mexp,          "\
-M.mexp([(X0, N0), (X1, N1), ...]) = X0^N0 X1^N1 ... mod M.m\n\
-\t(the list may be flattened if this more convenient.)")
+  METH (mexp,          "M.mexp([(X0, N0), (X1, N1), ...]) = "
+                                                 "X0^N0 X1^N1 ... mod M.m\n"
+                   "\t(the list may be flattened if this more convenient.)")
 #undef METHNAME
   { 0 }
 };
@@ -1375,7 +1375,7 @@ static PyTypeObject *mpmont_pytype, mpmont_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"MPMont(N): a Montgomery reduction context.",
+  "MPMont(N): a Montgomery reduction context.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1482,9 +1482,9 @@ static PyMethodDef mpbarrett_pymethods[] = {
 #define METHNAME(name) mbmeth_##name
   METH (reduce,        "B.reduce(X) -> X mod B.m")
   METH (exp,           "B.exp(X, N) -> X^N mod B.m")
-  METH (mexp,          "\
-B.mexp([(X0, N0), (X1, N1), ...]) = X0^N0 X1^N1 ... mod B.m\n\
-\t(the list may be flattened if this more convenient.)")
+  METH (mexp,          "B.mexp([(X0, N0), (X1, N1), ...]) = "
+                                                 "X0^N0 X1^N1 ... mod B.m\n"
+                   "\t(the list may be flattened if this more convenient.)")
 #undef METHNAME
   { 0 }
 };
@@ -1514,7 +1514,7 @@ static PyTypeObject *mpbarrett_pytype, mpbarrett_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"MPBarrett(N): a Barrett reduction context.",
+  "MPBarrett(N): a Barrett reduction context.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1642,7 +1642,7 @@ static PyTypeObject *mpreduce_pytype, mpreduce_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"MPReduce(N): a reduction context for reduction modulo Solinas primes.",
+  "MPReduce(N): a reduction context for reduction modulo Solinas primes.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1824,7 +1824,7 @@ static PyTypeObject *mpcrt_pytype, mpcrt_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"MPCRT(SEQ): a context for solving Chinese Remainder Theorem problems.",
+  "MPCRT(SEQ): a context for solving Chinese Remainder Theorem problems.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2011,8 +2011,7 @@ static PyMethodDef gf_pymethods[] = {
   METH (testbit,       "X.testbit(N) -> true/false if bit N set/clear in X")
   METH (sqr,           "X.sqr() -> X^2")
   METH (gcd,           "X.gcd(Y) -> gcd(X, Y)")
-  METH (gcdx,
-        "X.gcdx(Y) -> (gcd(X, Y), U, V) with X U + Y V = gcd(X, Y)")
+  METH (gcdx,   "X.gcdx(Y) -> (gcd(X, Y), U, V) with X U + Y V = gcd(X, Y)")
   METH (modinv,        "X.modinv(Y) -> multiplicative inverse of Y mod X")
   METH (irreduciblep,  "X.irreduciblep() -> true/false")
 #undef METHNAME
@@ -2020,10 +2019,10 @@ static PyMethodDef gf_pymethods[] = {
   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")
-  KWMETH(storeb2c,
-        "X.storeb2c([len = -1]) -> big-endian bytes, two's complement")
+  KWMETH(storel2c,     "X.storel2c([len = -1]) -> "
+                                    "little-endian bytes, two's complement")
+  KWMETH(storeb2c,     "X.storeb2c([len = -1]) -> "
+                                       "big-endian bytes, two's complement")
   METH (tobuf,         "X.tobuf() -> buffer format")
 #undef METHNAME
   { 0 }
@@ -2098,21 +2097,21 @@ static PyTypeObject gf_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"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\
-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\
-with an integer conversion.\n\
-\n\
-The name is hopelessly wrong from a technical point of view, but\n\
-but it's much easier to type than `p2' or `c2' or whatever.\n\
-\n\
-Notes:\n\
-\n\
-  * Use `//' for Euclidean division: `/' gives exact rational division.",
+  "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"
+  "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"
+  "with an integer conversion.\n"
+  "\n"
+  "The name is hopelessly wrong from a technical point of view, but\n"
+  "but it's much easier to type than `p2' or `c2' or whatever.\n"
+  "\n"
+  "Notes:\n"
+  "\n"
+  "  * Use `//' for Euclidean division: `/' gives exact rational division.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2290,7 +2289,7 @@ static PyMethodDef gfreduce_pymethods[] = {
 #define METHNAME(name) grmeth_##name
   METH (reduce,        "R.reduce(X) -> X mod B.m")
   METH (trace,        "R.trace(X) -> Tr(X) = x + x^2 + ... + x^{2^{m - 1}}")
-  METH (halftrace,   "R.halftrace(X) -> x + x^{2^2} + ... + x^{2^{m - 1}}")
+  METH (halftrace,    "R.halftrace(X) -> x + x^{2^2} + ... + x^{2^{m - 1}}")
   METH (sqrt,          "R.sqrt(X) -> Y where Y^2 = X mod R")
   METH (quadsolve,     "R.quadsolve(X) -> Y where Y^2 + Y = X mod R")
   METH (exp,           "R.exp(X, N) -> X^N mod B.m")
@@ -2323,7 +2322,7 @@ static PyTypeObject *gfreduce_pytype, gfreduce_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"GFReduce(N): a context for reduction modulo sparse polynomials.",
+  "GFReduce(N): a context for reduction modulo sparse polynomials.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -2461,8 +2460,8 @@ static PyTypeObject gfn_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"GFN(P, BETA): an object for transforming elements of binary fields\n\
-  between polynomial 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@ */
@@ -2489,38 +2488,26 @@ static PyTypeObject gfn_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  KWMETH(_MP_fromstring,       "\
-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\
-\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\
-or `R_' for other radix R.")
-  METH (_MP_factorial,         "\
-factorial(I) -> I!: compute factorial")
-  METH (_MP_fibonacci,         "\
-fibonacci(I) -> F(I): compute Fibonacci number")
-  METH (_MP_loadl,             "\
-loadl(STR) -> X: read little-endian bytes")
-  METH (_MP_loadb,             "\
-loadb(STR) -> X: read big-endian bytes")
-  METH (_MP_loadl2c,           "\
-loadl2c(STR) -> X: read little-endian bytes, two's complement")
-  METH (_MP_loadb2c,           "\
-loadb2c(STR) -> X: read big-endian bytes, two's complement")
-  METH (_MP_frombuf,           "\
-frombuf(STR) -> (X, REST): read buffer format")
-  METH (_GF_loadl,             "\
-loadl(STR) -> X: read little-endian bytes")
-  METH (_GF_loadb,             "\
-loadb(STR) -> X: read big-endian bytes")
-  METH (_GF_frombuf,           "\
-frombuf(STR) -> (X, REST): read buffer format")
+  KWMETH(_MP_fromstring, "fromstring(STR, [radix = 0]) -> (X, REST)\n"
+    "  Parse STR as a large integer, according to RADIX.  If RADIX is\n"
+    "  zero, read a prefix from STR to decide radix: allow `0b' for binary,\n"
+    "  `0' or `0o' for octal, `0x' for hex, or `R_' for other radix R.")
+  KWMETH(_GF_fromstring, "fromstring(STR, [radix = 0]) -> (X, REST)\n"
+    "  Parse STR as a binary polynomial, according to RADIX.  If RADIX is\n"
+    "  zero, read a prefix from STR to decide radix: allow `0b' for binary,\n"
+    "  `0' or `0o' for octal, `0x' for hex, or `R_' for other radix R.")
+  METH (_MP_factorial, "factorial(I) -> I!: compute factorial")
+  METH (_MP_fibonacci, "fibonacci(I) -> F(I): compute Fibonacci number")
+  METH (_MP_loadl,     "loadl(STR) -> X: read little-endian bytes")
+  METH (_MP_loadb,     "loadb(STR) -> X: read big-endian bytes")
+  METH (_MP_loadl2c,   "loadl2c(STR) -> X: "
+                               "read little-endian bytes, two's complement")
+  METH (_MP_loadb2c,   "loadb2c(STR) -> X: "
+                                  "read big-endian bytes, two's complement")
+  METH (_MP_frombuf,   "frombuf(STR) -> (X, REST): read buffer format")
+  METH (_GF_loadl,     "loadl(STR) -> X: read little-endian bytes")
+  METH (_GF_loadb,     "loadb(STR) -> X: read big-endian bytes")
+  METH (_GF_frombuf,   "frombuf(STR) -> (X, REST): read buffer format")
 #undef METHNAME
   { 0 }
 };
index 1796629ce8b85eb6fce2d60c5b3a1f193e34d5d7..4c8caf49c7f67588845d7f2062459c5473944451 100644 (file)
@@ -152,7 +152,7 @@ static PyTypeObject pixie_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Pixie([socket = ?]): passphrase pixie connection.",
+  "Pixie([socket = ?]): passphrase pixie connection.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -222,9 +222,9 @@ end:
 
 static PyMethodDef methods[] = {
 #define METHNAME(name) meth_##name
-  KWMETH(ppread,               "ppread(TAG, [mode = PMODE_READ]) -> STRING")
-  METH (ppcancel,              "ppcancel(TAG)")
-  METH (getpass,               "getpass(PROMPT) -> STRING")
+  KWMETH(ppread,       "ppread(TAG, [mode = PMODE_READ]) -> STRING")
+  METH (ppcancel,      "ppcancel(TAG)")
+  METH (getpass,       "getpass(PROMPT) -> STRING")
 #undef METHNAME
   { 0 }
 };
diff --git a/pgen.c b/pgen.c
index 8e1911b2077ce966c4c8565e696f5032c413bc1b..98daa73cfa6a0eafe49f93d3531b283de5908def 100644 (file)
--- a/pgen.c
+++ b/pgen.c
@@ -219,7 +219,7 @@ static PyTypeObject pfilt_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeFilter(X): 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@ */
-"RabinMiller(X): Rabin-Miller strong primality test.",
+  "RabinMiller(X): Rabin-Miller strong primality test.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -490,7 +490,7 @@ static PyTypeObject pgevent_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Prime-generation event.",
+  "Prime-generation event.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -669,7 +669,7 @@ static PyTypeObject pgev_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Built-in prime-generation event handler, base class.",
+  "Built-in prime-generation event handler, base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -743,7 +743,7 @@ static PyTypeObject pgstep_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeGenStepper(STEP): simple stepper with small-factors filter.",
+  "PrimeGenStepper(STEP): simple stepper with small-factors filter.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -825,7 +825,8 @@ static PyTypeObject pgjump_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeGenJumper(JUMP): stepper for larger steps with small-factors filter.",
+  "PrimeGenJumper(JUMP): "
+                      "stepper for larger steps with small-factors filter.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -886,7 +887,7 @@ static PyTypeObject pgtest_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"PrimeGenTester(): Rabin-Miller tester.",
+  "PrimeGenTester(): Rabin-Miller tester.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1051,21 +1052,22 @@ end:
 
 static PyMethodDef methods[] = {
 #define METHNAME(name) meth_##name
-  METH (_PrimeFilter_smallfactor,      "smallfactor(X) -> PGST")
-  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")
-  KWMETH(strongprime_setup,            "\
-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")
-  KWMETH(limlee,                       "\
-limlee(PBITS, QBITS, [name = 'p'], [event = pgen_nullev],\n\
-       [ievent = pgen_nullev], [rng = rand], [nsteps = 0]) -> (P, [Q, ...])")
+  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")
+  KWMETH(strongprime_setup,
+       "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")
+  KWMETH(limlee,
+       "limlee(PBITS, QBITS, [name = 'p'], [event = pgen_nullev],\n"
+       "       [ievent = pgen_nullev], [rng = rand], [nsteps = 0]) "
+                                                         "-> (P, [Q, ...])")
 #undef METHNAME
   { 0 }
 };
index 5680429c1a410cd81ee5724078a9b8abcf5b99be..3fc42af069cdeaf38d796fbc3be5b27c71c90465 100644 (file)
--- a/pubkey.c
+++ b/pubkey.c
@@ -191,16 +191,16 @@ end:
 
 static PyMethodDef dsapub_pymethods[] = {
 #define METHNAME(name) dsameth_##name
-  METH (beginhash,             "D.beginhash() -> hash object")
-  METH (endhash,               "D.endhash(H) -> BYTES")
-  METH (verify,                "D.verify(MSG, (R, S)) -> true/false")
+  METH (beginhash,     "D.beginhash() -> hash object")
+  METH (endhash,       "D.endhash(H) -> BYTES")
+  METH (verify,        "D.verify(MSG, (R, S)) -> true/false")
 #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 }
 };
@@ -247,7 +247,7 @@ static PyTypeObject dsapub_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"DSAPub(GROUP, P, [hash = sha], [rng = rand]): DSA public key.",
+  "DSAPub(GROUP, P, [hash = sha], [rng = rand]): DSA public key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -295,7 +295,8 @@ static PyTypeObject dsapriv_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"DSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): DSA private key.",
+  "DSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): "
+                                                         "DSA private key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -428,16 +429,16 @@ end:
 
 static PyMethodDef kcdsapub_pymethods[] = {
 #define METHNAME(name) kcdsameth_##name
-  METH (beginhash,             "D.beginhash() -> hash object")
-  METH (endhash,               "D.endhash(H) -> BYTES")
-  METH (verify,                "D.verify(MSG, (R, S)) -> true/false")
+  METH (beginhash,     "D.beginhash() -> hash object")
+  METH (endhash,       "D.endhash(H) -> BYTES")
+  METH (verify,        "D.verify(MSG, (R, S)) -> true/false")
 #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 }
 };
@@ -467,7 +468,7 @@ static PyTypeObject kcdsapub_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KCDSAPub(GROUP, P, [hash = sha], [rng = rand]): KCDSA public key.",
+  "KCDSAPub(GROUP, P, [hash = sha], [rng = rand]): KCDSA public key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -515,7 +516,8 @@ static PyTypeObject kcdsapriv_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"KCDSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): KCDSA private key.",
+  "KCDSAPriv(GROUP, U, [p = u G], [hash = sha], [rng = rand]): "
+                                                       "KCDSA private key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -758,35 +760,35 @@ end:
 
 static PyGetSetDef rsapub_pygetset[] = {
 #define GETSETNAME(op, name) rsa##op##_##name
-  GET  (n,                     "R.n -> N")
-  GET  (e,                     "R.e -> E")
+  GET  (n,             "R.n -> N")
+  GET  (e,             "R.e -> E")
 #undef GETSETNAME
   { 0 }
 };
 
 static PyMethodDef rsapub_pymethods[] = {
 #define METHNAME(name) rsameth_##name
-  METH (pubop,                 "R.pubop(X) -> X^E (mod N)")
+  METH (pubop,         "R.pubop(X) -> X^E (mod N)")
 #undef METHNAME
   { 0 }
 };
 
 static PyGetSetDef rsapriv_pygetset[] = {
 #define GETSETNAME(op, name) rsa##op##_##name
-  GET  (d,                     "R.d -> D")
-  GET  (p,                     "R.p -> P")
-  GET  (q,                     "R.q -> Q")
-  GET  (dp,                    "R.dp -> D mod (P - 1)")
-  GET  (dq,                    "R.dq -> D mod (Q - 1)")
-  GET  (q_inv,                 "R.q_inv -> Q^{-1} mod P")
-  GETSET(rng,                  "R.rng -> random number source for blinding")
+  GET  (d,             "R.d -> D")
+  GET  (p,             "R.p -> P")
+  GET  (q,             "R.q -> Q")
+  GET  (dp,            "R.dp -> D mod (P - 1)")
+  GET  (dq,            "R.dq -> D mod (Q - 1)")
+  GET  (q_inv,         "R.q_inv -> Q^{-1} mod P")
+  GETSET(rng,          "R.rng -> random number source for blinding")
 #undef GETSETNAME
   { 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 }
 };
@@ -816,7 +818,7 @@ static PyTypeObject rsapub_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"RSAPub(N, E): RSA public key.",
+  "RSAPub(N, E): RSA public key.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -864,8 +866,8 @@ static PyTypeObject rsapriv_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"RSAPriv(..., [rng = rand]): RSA private key.\n\
-  Keywords: n, e, d, p, q, dp, dq, q_inv; must provide enough",
+  "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@ */
@@ -1262,30 +1264,26 @@ EDDSAS(DEFEDDSA)
 
 static PyMethodDef methods[] = {
 #define METHNAME(name) meth_##name
-  KWMETH(_p1crypt_encode,              0)
-  KWMETH(_p1crypt_decode,              0)
-  KWMETH(_p1sig_encode,                        0)
-  KWMETH(_p1sig_decode,                        0)
-  KWMETH(_oaep_encode,                 0)
-  KWMETH(_oaep_decode,                 0)
-  KWMETH(_pss_encode,                  0)
-  KWMETH(_pss_decode,                  0)
-  KWMETH(_RSAPriv_generate,            "\
-generate(NBITS, [event = pgen_nullev], [rng = rand], [nsteps = 0]) -> R")
+  KWMETH(_p1crypt_encode, 0)
+  KWMETH(_p1crypt_decode, 0)
+  KWMETH(_p1sig_encode,        0)
+  KWMETH(_p1sig_decode,        0)
+  KWMETH(_oaep_encode, 0)
+  KWMETH(_oaep_decode, 0)
+  KWMETH(_pss_encode,  0)
+  KWMETH(_pss_decode,  0)
+  KWMETH(_RSAPriv_generate, "generate(NBITS, [event = pgen_nullev], "
+                                         "[rng = rand], [nsteps = 0]) -> R")
 #define DEFMETH(X, x)                                                  \
-  METH  (x,                            "\
-" #x "(KEY, PUBLIC) -> SHARED")
+  METH (x,             "" #x "(KEY, PUBLIC) -> SHARED")
   XDHS(DEFMETH)
 #undef DEFMETH
 #define DEFMETH(ED, ed, phdflt, sigver)                                        \
-  METH  (ed##_pubkey,                  "\
-" #ed "_pubkey(KEY) -> PUBLIC")                                                \
-  KWMETH(ed##_sign,                    "\
-" #ed "_sign(KEY, MSG, [pub = PUBLIC], "                               \
-        "[perso = STRING], [phflag = BOOL]) -> SIG")                   \
-  KWMETH(ed##_verify,                  "\
-" #ed "_verify(PUBLIC, MSG, SIG, "                                     \
-        "[perso = STRING], [phflag = BOOL]) -> BOOL")
+  METH (ed##_pubkey,   "" #ed "_pubkey(KEY) -> PUBLIC")                \
+  KWMETH(ed##_sign,    "" #ed "_sign(KEY, MSG, [pub = PUBLIC], "       \
+                          "[perso = STRING], [phflag = BOOL]) -> SIG") \
+  KWMETH(ed##_verify,  "" #ed "_verify(PUBLIC, MSG, SIG, "             \
+                         "[perso = STRING], [phflag = BOOL]) -> BOOL")
   EDDSAS(DEFMETH)
 #undef DEFMETH
 #undef METHNAME
diff --git a/rand.c b/rand.c
index add56c9b76f3b31f8d9a27d27e2e8c7ad74ae697..52864729ddcf16847d5b5a3d23a84eb7d5371443 100644 (file)
--- a/rand.c
+++ b/rand.c
@@ -309,7 +309,7 @@ static PyTypeObject grand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Generic random number source.",
+  "Generic random number source.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -366,7 +366,7 @@ static PyTypeObject lcrand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"LCRand([seed = 0]): linear congruential generator.",
+  "LCRand([seed = 0]): linear congruential generator.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -423,7 +423,7 @@ static PyTypeObject fibrand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"FibRand([seed = 0]): Fibonacci generator.",
+  "FibRand([seed = 0]): Fibonacci generator.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -568,7 +568,7 @@ static PyTypeObject truerand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"TrueRand(): true random number source.",
+  "TrueRand(): true random number source.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -778,8 +778,8 @@ static PyObject *gclrmeth_seek(PyObject *me, PyObject *arg)
 
 static PyGetSetDef gccrand_pygetset[] = {
 #define GETSETNAME(op, name) gccr##op##_##name
-  GET  (keysz,                 "CR.keysz -> acceptable key sizes")
-  GET  (name,                  "CR.name -> name of this kind of generator")
+  GET  (keysz,         "CR.keysz -> acceptable key sizes")
+  GET  (name,          "CR.name -> name of this kind of generator")
 #undef GETSETNAME
   { 0 }
 };
@@ -817,7 +817,7 @@ static PyTypeObject gccrand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Metaclass for symmetric crypto-based generators.",
+  "Metaclass for symmetric crypto-based generators.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -865,7 +865,7 @@ static PyTypeObject gcrand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Abstract base class for symmetric crypto-based generators.",
+  "Abstract base class for symmetric crypto-based generators.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -913,7 +913,7 @@ static PyTypeObject gclatinrand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Abstract base class for symmetric crypto-based generators.",
+  "Abstract base class for symmetric crypto-based generators.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1014,8 +1014,8 @@ static PyTypeObject sslprf_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"SSLRand(KEY, SEED, [ohash = md5], [ihash = sha]):\n\
-  RNG for SSL master secret.",
+  "SSLRand(KEY, SEED, [ohash = md5], [ihash = sha]):\n"
+  "  RNG for SSL master secret.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1063,8 +1063,8 @@ static PyTypeObject tlsdx_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"TLSDataExpansion(KEY, SEED, [mac = sha_hmac]):\n\
-  TLS data expansion function.",
+  "TLSDataExpansion(KEY, SEED, [mac = sha_hmac]):\n"
+  "  TLS data expansion function.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1112,8 +1112,8 @@ static PyTypeObject tlsprf_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"TLSPRF(KEY, SEED, [lmac = md5_hmac], [rmac = sha_hmac]):\n\
-  TLS pseudorandom function.",
+  "TLSPRF(KEY, SEED, [lmac = md5_hmac], [rmac = sha_hmac]):\n"
+  "  TLS pseudorandom function.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1193,7 +1193,7 @@ static PyTypeObject dsarand_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"DSARand(SEED): pseudorandom number generator for DSA parameters.",
+  "DSARand(SEED): pseudorandom number generator for DSA parameters.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1284,9 +1284,9 @@ static PyObject *bbsget_stepsz(PyObject *me, void *hunoz)
 
 static PyMethodDef bbs_pymethods[] = {
 #define METHNAME(name) bbsmeth_##name
-  METH (step,  "R.step(): steps the generator (not useful)")
-  METH (bits,  "R.bits(N) -> W: returns N bits (<= 32) from the generator")
-  METH (wrap,  "R.wrap(): flushes unused bits in internal buffer")
+  METH (step,          "R.step(): steps the generator (not useful)")
+  METH (bits,   "R.bits(N) -> W: returns N bits (<= 32) from the generator")
+  METH (wrap,          "R.wrap(): flushes unused bits in internal buffer")
 #undef METHNAME
   { 0 }
 };
@@ -1325,7 +1325,7 @@ static PyTypeObject bbs_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BlumBlumShub(N, [x = 2]): Blum-Blum-Shub pseudorandom number generator.",
+  "BlumBlumShub(N, [x = 2]): Blum-Blum-Shub pseudorandom number generator.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -1446,8 +1446,8 @@ static PyObject *bpget_q(PyObject *me, void *hunoz)
 
 static PyMethodDef bbspriv_pymethods[] = {
 #define METHNAME(name) bpmeth_##name
-  METH (ff,                    "R.ff(N): fast-forward N places")
-  METH (rew,                   "R.rew(N): rewind N places")
+  METH (ff,            "R.ff(N): fast-forward N places")
+  METH (rew,           "R.rew(N): rewind N places")
 #undef METHNAME
   { 0 }
 };
@@ -1486,8 +1486,8 @@ static PyTypeObject bbspriv_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"BBSPriv(..., [seed = 2]): Blum-Blum-Shub, with private key.\n\
-  Keywords: n, p, q; must provide at least two",
+  "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@ */
@@ -1514,9 +1514,8 @@ static PyTypeObject bbspriv_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(name) meth_##name
-  KWMETH(_BBSPriv_generate,            "\
-generate(NBITS, [event = pgen_nullev], [rng = rand],\n\
-        [nsteps = 0], [seed = 2]) -> R")
+  KWMETH(_BBSPriv_generate, "generate(NBITS, [event = pgen_nullev], "
+                             "[rng = rand], [nsteps = 0], [seed = 2]) -> R")
 #undef METHNAME
   { 0 }
 };
diff --git a/share.c b/share.c
index 77da423571f8a8b7378a64bf10e3b705cc21326e..342144e98ff91e5e3f55ca5b46e2803d440faed9 100644 (file)
--- a/share.c
+++ b/share.c
@@ -86,7 +86,7 @@ static PyTypeObject gfshare_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Binary-field secret sharing base class.",
+  "Binary-field secret sharing base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -174,8 +174,8 @@ static PyTypeObject gfsharesplit_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"GFShareSplit(THRESHOLD, SECRET, [rng = rand]): binary-field sharing:\n\
-   split secret into shares.",
+  "GFShareSplit(THRESHOLD, SECRET, [rng = rand]): binary-field sharing:\n"
+  "   split secret into shares.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -296,8 +296,8 @@ static PyTypeObject gfsharejoin_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"GFShareJoin(THRESHOLD, SIZE): binary field sharing:\n\
-  join shares to recover secret.",
+  "GFShareJoin(THRESHOLD, SIZE): binary field sharing:\n"
+  "  join shares to recover secret.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -378,7 +378,7 @@ static PyTypeObject share_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Prime-field secret sharing base class.",
+  "Prime-field secret sharing base class.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -471,8 +471,8 @@ static PyTypeObject sharesplit_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ShareSplit(THRESHOLD, SECRET, [modulus = ?], [rng = rand]):\n\
-  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@ */
@@ -595,8 +595,8 @@ static PyTypeObject sharejoin_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"ShareJoin(THRESHOLD, MODULUS): prime field secret sharing:\n\
-  join shares to recover secret.",
+  "ShareJoin(THRESHOLD, MODULUS): prime field secret sharing:\n"
+  "  join shares to recover secret.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
diff --git a/util.c b/util.c
index 723c819cc82dd3e8daaa39b58085a7c965d449a4..adb780034c2d762acab3fd27e98006193ddac663 100644 (file)
--- a/util.c
+++ b/util.c
@@ -504,7 +504,7 @@ static PyTypeObject itemiter_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Iterates over the keys of a mapping.",
+  "Iterates over the items of a mapping.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -562,7 +562,7 @@ static PyTypeObject valiter_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Iterates over the values of a mapping.",
+  "Iterates over the values of a mapping.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -845,7 +845,7 @@ static PyObject *meth__set_home_module(PyObject *me, PyObject *arg)
 
 static const PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_set_home_module,      "_set_home_module(MOD)")
+  METH (_set_home_module, "_set_home_module(MOD)")
 #undef METHNAME
   { 0 }
 };