aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-04-12 22:35:42 +0000
committerlloyd <[email protected]>2015-04-12 22:35:42 +0000
commit196b4b3f8bf93c343d59cb69f2b25413bf20b917 (patch)
tree276d5648954a001204145f2df74a83d0f75d1f1a
parent1f3676ff66fa6b444a45ce7196d9316de25d792d (diff)
Remove the stray binary character making Python3 unhappy, remove
encoding= flags since they are not needed anymore and broke Python2.
-rwxr-xr-xconfigure.py13
-rw-r--r--src/lib/math/numbertheory/numthry.cpp5
2 files changed, 6 insertions, 12 deletions
diff --git a/configure.py b/configure.py
index c22908047..be0efb983 100755
--- a/configure.py
+++ b/configure.py
@@ -7,16 +7,11 @@ Configuration program for botan
Botan is released under the Simplified BSD License (see license.txt)
-Tested with CPython 2.6, 2.7, 3.2, 3.3 and PyPy 1.5
+Tested with CPython 2.6, 2.7, and 3.3
-Python 2.5 works if you change the exception catching syntax:
- perl -pi -e 's/except (.*) as (.*):/except $1, $2:/g' configure.py
+CPython 2.5 and earlier are not supported
Jython - Target detection does not work (use --os and --cpu)
-
-CPython 2.4 and earlier are not supported
-
-Has not been tested with IronPython
"""
import sys
@@ -1688,7 +1683,7 @@ def generate_amalgamation(build_config, options):
fsname = '%s%s.cpp' % (amalg_basename, '_' + tgt if tgt else '' )
botan_amalgs_fs.append(fsname)
logging.info('Writing amalgamation source to %s' % (fsname))
- f = open(fsname, 'w', encoding='latin1')
+ f = open(fsname, 'w')
f.write(amalg_header)
f.write('\n#include "%s"\n' % (header_name))
@@ -1710,7 +1705,7 @@ def generate_amalgamation(build_config, options):
if tgt not in botan_amalgs:
botan_amalgs[tgt] = open_amalg_file(tgt)
for src in sorted(mod.source):
- contents = open(src, encoding='latin1').readlines()
+ contents = open(src, 'r').readlines()
for line in contents:
if botan_include.search(line):
continue
diff --git a/src/lib/math/numbertheory/numthry.cpp b/src/lib/math/numbertheory/numthry.cpp
index 565cc543a..5fa8d4541 100644
--- a/src/lib/math/numbertheory/numthry.cpp
+++ b/src/lib/math/numbertheory/numthry.cpp
@@ -259,7 +259,7 @@ size_t mr_test_iterations(size_t n_bits, size_t prob, bool random)
/*
* For randomly chosen numbers we can use the estimates from
- * http://www.math.dartmouth.edu/~carlp/PDF/paper88.pdf‎
+ * http://www.math.dartmouth.edu/~carlp/PDF/paper88.pdf
*
* These values are derived from the inequality for p(k,t) given on
* the second page.
@@ -311,8 +311,7 @@ bool is_prime(const BigInt& n, RandomNumberGenerator& rng,
for(size_t i = 0; i != test_iterations; ++i)
{
const BigInt a = BigInt::random_integer(rng, 2, n_minus_1);
-
- BigInt y = pow_mod(a);
+ const BigInt y = pow_mod(a);
if(mr_witness(std::move(y), reducer, n_minus_1, s))
return false;