Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ecdsa #22

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
370b127
small packaging tweaks
Mar 22, 2012
ebdf5f4
benchmarks: benchmark a higher number of reps of key-generation, beca…
Apr 1, 2012
b29b94b
bench: RSA key generation takes way too long to use high reps, so sep…
Apr 1, 2012
7f15ab0
remove ChangeLog from MANIFEST.in
Apr 1, 2012
00b03ef
bench: benchmark larger strings because we're not capable of measurin…
Apr 1, 2012
0e4720d
add suppressions for a slightly newer version of gcc and CPython on s…
Apr 1, 2012
6774859
force local rep_bench instead of pyutil rep_bench, and use both time.…
Apr 1, 2012
aa9a5ae
print out deltat and deltac whenever either is ≤ 0
Apr 1, 2012
43fd4a0
print out deltac and deltat whenever they are more than 1 ms apart
Apr 1, 2012
2fb3272
fix typo in new suppressions
Apr 1, 2012
e159c03
print out deltadelta
Apr 1, 2012
9e70642
add dummy functions in order to test the accuracy of the clocks
Apr 1, 2012
6308308
Merge branch 'master' into explore-timetime-vs-timeclock
Apr 1, 2012
7f134ca
fix bug in calculation of meanc
Apr 1, 2012
f782ab3
tune the size of the job to be benchmarked so it falls into the range…
Apr 1, 2012
3eb69a5
bench: it turns out that hashing or ciphering even 1 MB of data is to…
Apr 1, 2012
c0b4b30
bench: remove comparison of time.time() vs. time.clock(); use time.cl…
Apr 1, 2012
10138f4
remove Null and Sleep signers which were for calibrating clocks
Apr 1, 2012
8bb096b
show-tool-versions.py: print out L1 cache line size (on Linux, at least)
Nov 28, 2012
3866382
improved suppressions file for valgrind+python
Mar 11, 2013
a7f5955
several extra self-checks in rsa.cpp
Mar 11, 2013
0a2474f
test for overrun of the output buffer when reading
Apr 11, 2013
2a38bfd
always define CRYPTOPP_DISABLE_ASM=1
Apr 11, 2013
5c2e0f7
disable asm only when we're building the embedded libcryptopp
Apr 12, 2013
417e746
remove ecdsa -- it has been replaced by ed25519
Apr 13, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions ChangeLog

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include copyright COPYING.GPL COPYING.TGPPL.html ChangeLog NEWS.rst README.rst
include copyright COPYING.GPL COPYING.TGPPL.html NEWS.rst README.rst
include COPYING.ed25519 README.ed25519.rst
include MANIFEST.in
include versioneer.py
Expand Down
38 changes: 23 additions & 15 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
2011-01-16 -- pycryptopp v0.5.28
2012-03-13 Zooko Wilcox-O'Hearn <[email protected]>

* re-enable the ECDSA module, but please do not rely on it as it is expected to change in backwards-incompatible ways in future releases
* several changes to the build system to make it tidier and less error-prone -- see revision control history for details
• src/pycryptopp/_version.py: release pycryptopp-0.6.0
• add Ed25519 signatures (#75)
• add XSalsa20 cipher (#40)
• switch from darcs to git for revision control
• pycryptopp version numbers now include a decimal encoding of the
git revid
• reorganize the source tree and the version number generation
• aesmodule.cpp: validate size of IV and throw exception if it is not 16 (#70)
• fixed compile errors with gcc-4.7.0 (#78)
• fixed compile errors concerning "CryptoPP::g_nullNameValuePairs" (#77)
• suppress warnings from valgrind with new OpenSSL 1.0.1 on Fedora (#82)
• raise Python exception instead of uncaught C++ exception
(resulting in abort) when deserializing malformed RSA keys (#83)

2010-09-20 -- pycryptopp v0.5.25
2009-09-15 Zooko Wilcox-O'Hearn <[email protected]>

* make setup backwards-compatible to Python 2.4
* fix incompatibilities between setup script and older versions of darcsver
* don't attempt to compile Mac OS X extended attribute files (this fixes the build breaking)
* include a version number of the specific version of Crypto++ in extraversion.h
* small changes to docs
• release pycryptopp-0.5.17
• publickey/rsamodule.cpp, publickey/ecdsamodule.cpp,
hash/sha256module.cpp, cipher/aesmodule.cpp: fix a segfault bug
when sizeof(size_t) > sizeof(int) (not exploitable); thanks Nathan
Wilcox and Brian Warner. (#19)

2010-09-18 -- pycryptopp v0.5.20
2009-07-27 Zooko Wilcox-O'Hearn <[email protected]>

* fix bugs in assembly implementation of SHA-256 from Crypto++
* fix it to compile on \*BSD (#39)
* improve doc strings
* add a quick start-up-self-test of SHA256 (#43)
* execute the quick start-up-self-tests of AES and SHA256 on module import
• release pycryptopp-0.5.16
• setup.py, misc/: a few improvements to the build/packaging
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ supporting them.

• RSA from the Crypto++ library ; see pycryptopp.publickey.rsa ; deprecated
in favor of Ed25519
• Ecdsa from the Crypto++ library ; see pycryptopp.publickey.ecdsa ;
deprecated in favor of Ed25519
• SHA-256 from the Crypto++ library ; see pycryptopp.hash.sha256 ; deprecated
in favor of the Python Standard Library's hashlib module

Expand Down
17 changes: 17 additions & 0 deletions misc/build_helpers/show-tool-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ def print_py_pkg_ver(pkgname, modulename=None):
except AttributeError:
pass

def print_cache_line_size():
label = "cache line size"
try:
result = open('/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size', 'rU').read().strip()
except EnvironmentError, e:
if isinstance(e, OSError) and e.errno == 2:
print label + ': no such file or directory'
return
sys.stderr.write("\nGot exception trying to read cache line sizes out of /sys/. Exception follows.\n")
traceback.print_exc(file=sys.stderr)
sys.stderr.flush()
pass
else:
print label + ': ' + result

print_platform()
print
print_python_ver()
Expand Down Expand Up @@ -157,3 +172,5 @@ def print_py_pkg_ver(pkgname, modulename=None):
print_py_pkg_ver('pyOpenSSL', 'OpenSSL')
print_py_pkg_ver('pycryptopp')
print_py_pkg_ver('crpyto')

print_cache_line_size()
111 changes: 92 additions & 19 deletions misc/coding_helpers/python.supp
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,29 @@
fun:_dl_catch_error
}

# generated on luther sid
# generated on luther sid with "python: 2.7.2+ (default, Jan 20 2012, 23:05:38) [GCC 4.6.2]"
# e.g. https://tahoe-lafs.org/buildbot-pycryptopp/builders/luther%20sid/builds/38/steps/double%20load%20valgrind/logs/valgrind
{
luther sid addr4 realloc
Memcheck:Addr4
fun:PyObject_Realloc.part.0.20700
fun:PyObject_Realloc.*
}

{
luther sid cond realloc
Memcheck:Cond
fun:PyObject_Realloc.part.0.20700
fun:PyObject_Realloc.*
}

{
luther sid value4 realloc
Memcheck:Value4
fun:PyObject_Realloc.part.0.20700
fun:PyObject_Realloc.*
}

# glibc was apparently changed to avoid this: http://sources.redhat.com/bugzilla/show_bug.cgi?id=4306
{
use (not really, according to Ulrich Drepper) of uninitailised bytes by glibc in utimes()
use (not really, according to Ulrich Drepper) of uninitialised bytes by glibc in utimes()
Memcheck:Param
utimes(tvp[1])
fun:utimes
Expand Down Expand Up @@ -172,7 +172,7 @@
{
ADDRESS_IN_RANGE/Invalid read of size 8
Memcheck:Value8
fun:PyObject_Realloc
fun:PyObject_Realloc.*
}

{
Expand All @@ -181,15 +181,95 @@
fun:PyObject_Realloc
}

{
python mem management stuff I assume
Memcheck:Addr4
obj:/usr/bin/python2.7
fun:_PyObject_GC_Resize
fun:PyFrame_New
}

{
more python mem management stuff I assume
Memcheck:Cond
obj:/usr/bin/python2.7
fun:_PyObject_GC_Resize
fun:PyFrame_New
}

{
more python mem management stuff I assume
Memcheck:Value8
obj:/usr/bin/python2.7
fun:_PyObject_GC_Resize
fun:PyFrame_New
}

{
more python mem management stuff I assume
Memcheck:Addr4
obj:/usr/bin/python2.7
fun:_PyString_Resize
}

{
more python mem management stuff I assume
Memcheck:Cond
obj:/usr/bin/python2.7
fun:_PyString_Resize
}

{
more python mem management stuff I assume
Memcheck:Value8
obj:/usr/bin/python2.7
fun:_PyString_Resize
}

{
more python mem management stuff I assume
Memcheck:Cond
obj:/usr/bin/python2.7
fun:PyNode_AddChild
}

{
more python mem management stuff I assume
Memcheck:Value8
obj:/usr/bin/python2.7
fun:PyNode_AddChild
}

{
more python mem management stuff I assume
Memcheck:Addr4
obj:/usr/bin/python2.7
fun:PyNode_AddChild
}

{
more python mem management stuff I assume
Memcheck:Addr4
obj:/usr/bin/python2.7
...
obj:/usr/bin/python2.7
fun:PyAST_Compile
}

{
more python mem management stuff I assume
Memcheck:Addr4
obj:/usr/bin/python2.7
...
obj:/usr/bin/python2.7
fun:PyAST_Compile
}

{
some unknown problem in python getdynloadfunc
Memcheck:Addr8
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
...
obj:/lib/ld-2.7.so
obj:/lib/libdl-2.7.so
obj:/lib/ld-2.7.so
Expand All @@ -202,14 +282,7 @@
some other unknown problem in python libdl stuff
Memcheck:Addr8
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
obj:/lib/ld-2.7.so
...
obj:/lib/ld-2.7.so
obj:/lib/libdl-2.7.so
obj:/lib/ld-2.7.so
Expand Down
57 changes: 5 additions & 52 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

# Copyright © 2009-2012 Zooko Wilcox-O'Hearn
# Copyright © 2009-2013 Zooko Wilcox-O'Hearn
# Author: Zooko Wilcox-O'Hearn
#
# See README.rst for licensing information.

import os, platform, re, subprocess, sys
import os, platform, re, sys

from setuptools import Extension, setup
from setuptools import Command
Expand All @@ -18,9 +18,6 @@

import versioneer

# ECDSA=False
ECDSA=True

DEBUG=False
if "--debug" in sys.argv:
DEBUG=True
Expand Down Expand Up @@ -106,28 +103,14 @@
else:
# Build the bundled Crypto++ library which is included by source
# code in the pycryptopp tree and link against it.
define_macros.append(('CRYPTOPP_DISABLE_ASM', 1))

include_dirs.append(".")

if 'sunos' in platform.system().lower():
extra_compile_args.append('-Wa,--divide') # allow use of "/" operator

if 'win32' in sys.platform.lower():
try:
res = subprocess.Popen(['cl'], stdin=open(os.devnull), stdout=subprocess.PIPE).communicate()
except EnvironmentError, le:
# Okay I guess we're not using the "cl.exe" compiler.
using_msvc = False
else:
using_msvc = True
else:
using_msvc = False

if using_msvc:
# We can handle out-of-line assembly.
cryptopp_src = [ os.path.join(EMBEDDED_CRYPTOPP_DIR, x) for x in os.listdir(EMBEDDED_CRYPTOPP_DIR) if x.endswith(('.cpp', '.asm')) ]
else:
# We can't handle out-of-line assembly.
cryptopp_src = [ os.path.join(EMBEDDED_CRYPTOPP_DIR, x) for x in os.listdir(EMBEDDED_CRYPTOPP_DIR) if x.endswith('.cpp') ]
cryptopp_src = [ os.path.join(EMBEDDED_CRYPTOPP_DIR, x) for x in os.listdir(EMBEDDED_CRYPTOPP_DIR) if x.endswith('.cpp') ]

# Mac OS X extended attribute files when written to a non-Mac-OS-X
# filesystem come out as "._$FNAME", for example "._rdtables.cpp",
Expand All @@ -137,34 +120,6 @@

extra_srcs.extend(cryptopp_src)

# In either case, we must provide a value for CRYPTOPP_DISABLE_ASM that
# matches the one used when Crypto++ was originally compiled. The Crypto++
# GNUmakefile tests the assembler version and only enables assembly for
# recent versions of the GNU assembler (2.10 or later). The /usr/bin/as on
# Mac OS-X 10.6 is too old.

try:
sp = subprocess.Popen(['as', '-v'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True)
sp.stdin.close()
sp.wait()
if re.search("GNU assembler version (0|1|2.0)", sp.stderr.read()):
define_macros.append(('CRYPTOPP_DISABLE_ASM', 1))
except EnvironmentError:
# Okay, nevermind. Maybe there isn't even an 'as' executable on this
# platform.
pass
else:
try:
# that "as -v" step creates an empty a.out, so clean it up. Modern GNU
# "as" has --version, which emits the version number without actually
# assembling anything, but older versions only have -v, which emits a
# version number and *then* assembles from stdin.
os.unlink("a.out")
except EnvironmentError:
pass

trove_classifiers=[
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License (GPL)", # See README.rst for alternative licensing.
Expand Down Expand Up @@ -192,8 +147,6 @@
'src/pycryptopp/cipher/aesmodule.cpp',
'src/pycryptopp/cipher/xsalsa20module.cpp',
]
if ECDSA:
srcs.append('src/pycryptopp/publickey/ecdsamodule.cpp')
if BUILD_DOUBLE_LOAD_TESTER:
srcs.append('_doubleloadtester.cpp', )

Expand Down
10 changes: 9 additions & 1 deletion src-cryptopp/osrng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ void NonblockingRng::GenerateBlock(byte *output, size_t size)
if (!CryptGenRandom(m_Provider.GetProviderHandle(), (DWORD)size, output))
throw OS_RNG_Err("CryptGenRandom");
#else
if (read(m_fd, output, size) != size)
byte tmpbuf[size * 2];
size_t i;
for (i = size ; i < size * 2; i++)
tmpbuf[i] = i;
if (read(m_fd, tmpbuf, size) != size)
throw OS_RNG_Err("read /dev/urandom");
for (i = size ; i < size * 2; i++)
if (tmpbuf[i] != i)
throw OS_RNG_Err("read /dev/urandom overran buffer");
memcpy(output, tmpbuf, size);
#endif
}

Expand Down
Loading