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 }
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Key size constraints. Abstract.",
+ "Key size constraints. Abstract.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Symmetric cipher metaclass.",
+ "Symmetric cipher metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Symmetric cipher, abstract base class.",
+ "Symmetric cipher, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
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 }
};
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 }
};
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 }
};
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 }
};
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 }
};
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 }
};
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption (key) metaclass.",
+ "Authenticated encryption (key) metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption key.",
+ "Authenticated encryption key.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption additional-data hash metaclass.",
+ "Authenticated encryption additional-data hash metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption AAD hash.",
+ "Authenticated encryption AAD hash.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption operation metaclass.",
+ "Authenticated encryption operation metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated encryption operation.",
+ "Authenticated encryption operation.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated decryption operation metaclass.",
+ "Authenticated decryption operation metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Authenticated decryption operation.",
+ "Authenticated decryption operation.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Hash function metaclass.",
+ "Hash function metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Hash function, abstract base class.",
+ "Hash function, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Message authentication code metametaclass.",
+ "Message authentication code metametaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Message authentication code, abstract base class.",
+ "Message authentication code, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Poly1305 metametaclass. Best not to ask.",
+ "Poly1305 metametaclass. Best not to ask.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"poly1305(K): Poly1305 key.",
+ "poly1305(K): Poly1305 key.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Poly1305 MAC context base class.",
+ "Poly1305 MAC context base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"SHAKE/cSHAKE base class.",
+ "SHAKE/cSHAKE/KMAC base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Pseudorandom permutation metaclass.",
+ "Pseudorandom permutation metaclass.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Pseudorandom permutation, abstract base class.",
+ "Pseudorandom permutation, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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")
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"ReadBuffer(STR): a read buffer.",
+ "ReadBuffer(STR): a read buffer.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"WriteBuffer([size = ?]): a write buffer.",
+ "WriteBuffer([size = ?]): a write buffer.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"ByteString(STR): byte string class.",
+ "ByteString(STR): byte string class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
static PyMethodDef methods[] = {
#define METHNAME(func) meth_##func
- METH (_ego, "_ego(ARGV0)")
+ METH (_ego, "_ego(ARGV0)")
#undef METHNAME
{ 0 }
};
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@ */
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@ */
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
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"An elliptic curve. Abstract class.",
+ "An elliptic curve. Abstract class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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@ */
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@ */
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Finite field elements, abstract base class.",
+ "Finite field elements, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"PrimeField(P): prime fields.",
+ "PrimeField(P): prime fields.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Binary fields. Abstract class.",
+ "Binary fields. Abstract class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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 }
};
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 }
};
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@ */
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@ */
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@ */
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
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Group elements, abstract base class.",
+ "Group elements, abstract base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Abstract base class for groups.",
+ "Abstract base class for groups.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"PrimeGroup(INFO): subgroups of prime fields.",
+ "PrimeGroup(INFO): subgroups of prime fields.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"BinGroup(INFO): subgroups of binary fields.",
+ "BinGroup(INFO): subgroups of binary fields.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"ECGroup(INFO): elliptic curve groups.",
+ "ECGroup(INFO): elliptic curve groups.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
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 }
};
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Key data base class.",
+ "Key data base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
static PyGetSetDef keydatabin_pygetset[] = {
#define GETSETNAME(op, name) kdb##op##_##name
- GET (bin, "KD.bin -> BYTES")
+ GET (bin, "KD.bin -> BYTES")
#undef GETSETNAME
{ 0 }
};
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@ */
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 }
};
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@ */
static PyGetSetDef keydatamp_pygetset[] = {
#define GETSETNAME(op, name) kdm##op##_##name
- GET (mp, "KD.mp -> X")
+ GET (mp, "KD.mp -> X")
#undef GETSETNAME
{ 0 }
};
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@ */
static PyGetSetDef keydatastr_pygetset[] = {
#define GETSETNAME(op, name) kds##op##_##name
- GET (str, "KD.str -> STRING")
+ GET (str, "KD.str -> STRING")
#undef GETSETNAME
{ 0 }
};
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@ */
static PyGetSetDef keydataec_pygetset[] = {
#define GETSETNAME(op, name) kde##op##_##name
- GET (ecpt, "KD.ecpt -> ECPT")
+ GET (ecpt, "KD.ecpt -> ECPT")
#undef GETSETNAME
{ 0 }
};
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Iterator for structured keys.",
+ "Iterator for structured keys.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Iterator for key attributes.",
+ "Iterator for key attributes.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Keyring iterator.",
+ "Keyring iterator.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
#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")
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@ */
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 }
};
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 }
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@ */
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 }
};
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"MPMont(N): a Montgomery reduction context.",
+ "MPMont(N): a Montgomery reduction context.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
#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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"MPBarrett(N): a Barrett reduction context.",
+ "MPBarrett(N): a Barrett reduction context.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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
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 }
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@ */
#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")
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@ */
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Pixie([socket = ?]): passphrase pixie connection.",
+ "Pixie([socket = ?]): passphrase pixie connection.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"PrimeFilter(X): small-primes filter.",
+ "PrimeFilter(X): small-primes filter.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Prime-generation event.",
+ "Prime-generation event.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"PrimeGenTester(): Rabin-Miller tester.",
+ "PrimeGenTester(): Rabin-Miller tester.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
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 }
};
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@ */
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@ */
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 }
};
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@ */
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"RSAPub(N, E): RSA public key.",
+ "RSAPub(N, E): RSA public key.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Generic random number source.",
+ "Generic random number source.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"LCRand([seed = 0]): linear congruential generator.",
+ "LCRand([seed = 0]): linear congruential generator.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"FibRand([seed = 0]): Fibonacci generator.",
+ "FibRand([seed = 0]): Fibonacci generator.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"TrueRand(): true random number source.",
+ "TrueRand(): true random number source.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Metaclass for symmetric crypto-based generators.",
+ "Metaclass for symmetric crypto-based generators.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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@ */
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@ */
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@ */
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@ */
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 }
};
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@ */
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 }
};
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@ */
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 }
};
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Binary-field secret sharing base class.",
+ "Binary-field secret sharing base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
Py_TPFLAGS_BASETYPE,
/* @tp_doc@ */
-"Prime-field secret sharing base class.",
+ "Prime-field secret sharing base class.",
0, /* @tp_traverse@ */
0, /* @tp_clear@ */
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@ */
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@ */
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@ */
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@ */
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 }
};