diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2012-04-25 16:17:02 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2012-04-25 16:17:02 -0400 |
commit | 8f64badf1640bccb42d0bcf1f54d9c484ddd1e51 (patch) | |
tree | 5f471ffa859010de7cfd3347ba5f59feaf0a60b9 | |
parent | 88b4a886ccffef2f6cdbd20f8c983eb5ded1c813 (diff) | |
download | pycrypto-8f64badf1640bccb42d0bcf1f54d9c484ddd1e51.tar.gz |
some comments
-rw-r--r-- | src/_fastmath.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/_fastmath.c b/src/_fastmath.c index 41734aa..80a18ce 100644 --- a/src/_fastmath.c +++ b/src/_fastmath.c @@ -1062,7 +1062,7 @@ isPrime (PyObject * self, PyObject * args, PyObject * kwargs) longObjToMPZ (n, (PyLongObject *) l); Py_BEGIN_ALLOW_THREADS; - /* first check if n is known to be prime and do some trail division */ + /* first check if n is known to be prime and do some trial division */ for (i = 0; i < SIEVE_BASE_SIZE; ++i) { if (mpz_cmp_ui (n, sieve_base[i]) == 0) @@ -1342,6 +1342,7 @@ rabinMillerTest (mpz_t n, int rounds, PyObject *randfunc) } Py_BEGIN_ALLOW_THREADS; + /* check special cases (n==2, n even, n < 2) */ if ((mpz_tstbit (n, 0) == 0) || (mpz_cmp_ui (n, 3) < 0)) { return_val = (mpz_cmp_ui (n, 2) == 0); Py_BLOCK_THREADS; |