summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>2016-11-12 09:44:27 +0530
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>2016-11-12 09:44:27 +0530
commit1edafce055fd325b6618bbbc3fb3645a96c0ded2 (patch)
tree8af4bd3d580ef6d86790378534b441ac436d4afd
parentdc3a10d68e1b549024eb307c73b0d0a449a48053 (diff)
Imported Upstream version 0.7.1
-rw-r--r--.gitattributes1
-rw-r--r--.gitignore22
-rw-r--r--.travis.yml17
-rw-r--r--COPYING.GPL114
-rw-r--r--COPYING.MIT.txt (renamed from COPYING.ed25519)7
-rw-r--r--COPYING.SPL.txt3
-rw-r--r--COPYING.TGPPL.html80
-rw-r--r--COPYING.TGPPL.rst291
-rw-r--r--ChangeLog28
-rw-r--r--MANIFEST.in4
-rw-r--r--NEWS.rst44
-rw-r--r--PKG-INFO109
-rw-r--r--README.ed25519.rst21
-rw-r--r--README.rst83
-rw-r--r--copyright24
-rw-r--r--misc/build_helpers/show-tool-versions.py3
-rw-r--r--misc/coding_helpers/python.supp20
-rw-r--r--pycryptopp.egg-info/PKG-INFO109
-rw-r--r--pycryptopp.egg-info/SOURCES.txt257
-rw-r--r--pycryptopp.egg-info/dependency_links.txt1
-rw-r--r--pycryptopp.egg-info/not-zip-safe1
-rw-r--r--pycryptopp.egg-info/requires.txt1
-rw-r--r--pycryptopp.egg-info/top_level.txt1
-rw-r--r--setup.cfg13
-rw-r--r--setup.py153
-rw-r--r--src-cryptopp/extraversion.h8
-rw-r--r--src/pycryptopp/_version.py8
-rw-r--r--src/pycryptopp/bench/__init__.py0
-rw-r--r--src/pycryptopp/bench/bench_algs.py9
-rw-r--r--src/pycryptopp/bench/bench_ciphers.py45
-rw-r--r--src/pycryptopp/bench/bench_hashes.py52
-rw-r--r--src/pycryptopp/bench/bench_sigs.py151
-rw-r--r--src/pycryptopp/bench/common.py67
-rw-r--r--src/pycryptopp/cipher/aesmodule.cpp2
-rw-r--r--src/pycryptopp/publickey/ecdsamodule.cpp52
-rw-r--r--src/pycryptopp/publickey/ed25519/__init__.py4
-rw-r--r--src/pycryptopp/publickey/ed25519/keys.py17
-rw-r--r--src/pycryptopp/test/test_aes.py2
-rw-r--r--src/pycryptopp/test/test_ecdsa.py17
-rw-r--r--src/pycryptopp/test/test_from_Nikratio.py2
-rw-r--r--src/pycryptopp/test/test_rsa.py2
-rw-r--r--src/pycryptopp/test/test_sha256.py2
-rw-r--r--src/pycryptopp/test/test_xsalsa20.py2
43 files changed, 1032 insertions, 817 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..4e25b81
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+pycryptopp/_version.py export-subst
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..915ef37
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+
+/build/
+/dist/
+
+# extraversion.h is generated at build time, and never checked in
+/src-cryptopp/extraversion.h
+/src/pycryptopp/_version.py
+
+# the .egg-info is mostly generated during 'setup.py bdist_egg' ..
+/pycryptopp.egg-info/
+# .. but stdeb.cfg is persistent, and tracked in version-control
+!/pycryptopp.egg-info/stdeb.cfg
+
+# if setup.py needs to install plugins from eggs to satisfy setup_requires:
+/setuptools_darcs*.egg
+/darcsver*.egg
+/pyutil*.egg
+
+# if ez_setup.py needs to build setuptools, that goes here
+/setuptools-*.egg
+/ez_setup.pyc
+/MANIFEST
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..fabbe70
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+language: python
+python:
+ - "2.7"
+ - "2.6"
+before_install:
+ - sh -c set
+install: true
+script: python setup.py test
+notifications:
+ email: false
+ irc:
+ channels: "chat.freenode.net#tahoe-lafs"
+ on_success: always # for testing
+ on_failure: always
+ template:
+ - "%{repository}#%{build_number} [%{branch}: %{commit} by %{author}] %{message}"
+ - "Changes: %{compare_url} | Details: %{build_url}"
diff --git a/COPYING.GPL b/COPYING.GPL
index 8b7796c..5075166 100644
--- a/COPYING.GPL
+++ b/COPYING.GPL
@@ -1,7 +1,113 @@
-This licence also comes with the added permission that you may link this
-program with the OpenSSL library and distribute executables, as long as you
-follow the requirements of this licence in regard to all of the software in
-the executable aside from OpenSSL.
+This work also comes with the added permission that you may combine it with a
+work licensed under the OpenSSL license (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the OpenSSL license.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Eclipse Public Licence (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Eclipse Public Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Q Public Licence (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Q Public Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Apache Licence (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Apache Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the GNU Lesser General Public License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the GNU Lesser
+General Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Zope Public License (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Zope Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Python Software Foundation License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Python
+Software Foundation License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Academic Free License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Academic Free License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Apple Public Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Apple Public
+Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the BitTorrent Open Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the BitTorrent
+Open Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Lucent Public License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Lucent Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Jabber Open Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Jabber Open
+Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Common Development and Distribution License (any
+version) and distribute the resulting combined work, as long as you follow
+the requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Common
+Development and Distribution License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Microsoft Public License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Microsoft Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Microsoft Reciprocal License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Microsoft
+Reciprocal License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Sun Industry Standards Source License (any version)
+and distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Sun Industry
+Standards Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Open Software License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Open Software License.
+
GNU GENERAL PUBLIC LICENSE
diff --git a/COPYING.ed25519 b/COPYING.MIT.txt
index a40b040..fbf28f0 100644
--- a/COPYING.ed25519
+++ b/COPYING.MIT.txt
@@ -1,9 +1,4 @@
-"python-ed25519" Copyright (c) 2011 Brian Warner
-
-Portions written by the Ed25519 Contributors and placed in the
-public domain.
-
-Permission is hereby granted, free of charge, to any person
+Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
diff --git a/COPYING.SPL.txt b/COPYING.SPL.txt
new file mode 100644
index 0000000..a5389bc
--- /dev/null
+++ b/COPYING.SPL.txt
@@ -0,0 +1,3 @@
+Permission is hereby granted to any person obtaining a copy of this work to
+deal in this work without restriction (including the rights to use, modify,
+distribute, sublicense, and/or sell copies).
diff --git a/COPYING.TGPPL.html b/COPYING.TGPPL.html
deleted file mode 100644
index b23acdd..0000000
--- a/COPYING.TGPPL.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCtype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html lang="en">
-
- <head>
- <title>transitive grace period public licence, v1.0</title>
-
- <link rev="made" class="mailto" href="mailto:zooko[at]zooko[dot]com">
-
- <link rel="stylesheet" href="style.css" type="text/css">
-
- <meta name="description" content="an open source licence for commercial software">
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
- <meta name="keywords" content="Zooko">
- </head>
-
- <body>
-<h1>Transitive Grace Period Public Licence ("TGPPL") v. 1.0</h1>
-
-<p>This Transitive Grace Period Public Licence (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
-
-<p><b>Licensed under the Transitive Grace Period Public Licence version 1.0</b></p>
-
-<ol>
- <li><b>Grant of Copyright License.</b> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:</p>
-
- <ol type="a">
- <li>to reproduce the Original Work in copies, either alone or as part of a collective work;</p>
-
- <li>to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;</p>
-
- <li>to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Transitive Grace Period Public Licence no later than 12 months after You distributed or communicated said copies;</p>
-
- <li>to perform the Original Work publicly; and</p>
-
- <li>to display the Original Work publicly.</p>
- </ol>
-
- <li><b>Grant of Patent License.</b> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.</p>
-
- <li><b>Grant of Source Code License.</b> The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.</p>
-
- <li><b>Exclusions From License Grant.</b> Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.</p>
-
- <li><b>External Deployment.</b> The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).</p>
-
- <li><b>Attribution Rights.</b> You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.</p>
-
- <li><b>Warranty of Provenance and Disclaimer of Warranty.</b> Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.</p>
-
- <li><b>Limitation of Liability.</b> Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.</p>
-
- <li><b>Acceptance and Termination.</b> If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).</p>
-
- <li><b>Termination for Patent Action.</b> This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.</p>
-
- <li><b>Jurisdiction, Venue and Governing Law.</b> Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.</p>
-
- <li><b>Attorneys' Fees.</b> In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.</p>
-
- <li><b>Miscellaneous.</b> If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.</p>
-
- <li><b>Definition of "You" in This License.</b> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
-
- <li><b>Right to Use.</b> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
-
- <li><b>Modification of This License.</b> This License is Copyright 2007 Zooko Wilcox-O'Hearn. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Transitive Grace Period Public Licence" or "TGPPL" and you may not use those names in the name of your Modified License; and (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License.</p>
-</ol>
-
- </td>
- </td>
- </tr>
-
- </table>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/COPYING.TGPPL.rst b/COPYING.TGPPL.rst
new file mode 100644
index 0000000..e89b079
--- /dev/null
+++ b/COPYING.TGPPL.rst
@@ -0,0 +1,291 @@
+This work also comes with the added permission that you may combine it with a
+work licensed under the OpenSSL license (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the OpenSSL license.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Eclipse Public Licence (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Eclipse Public Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Q Public Licence (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Q Public Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Apache Licence (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Apache Licence.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the GNU Lesser General Public License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the GNU Lesser
+General Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Zope Public License (any version) and distribute the
+resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Zope Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Python Software Foundation License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Python
+Software Foundation License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Academic Free License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Academic Free License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Apple Public Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Apple Public
+Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the BitTorrent Open Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the BitTorrent
+Open Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Lucent Public License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Lucent Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Jabber Open Source License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Jabber Open
+Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Common Development and Distribution License (any
+version) and distribute the resulting combined work, as long as you follow
+the requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Common
+Development and Distribution License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Microsoft Public License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Microsoft Public License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Microsoft Reciprocal License (any version) and
+distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Microsoft
+Reciprocal License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Sun Industry Standards Source License (any version)
+and distribute the resulting combined work, as long as you follow the
+requirements of the licences of this work in regard to all of the
+resulting combined work aside from the work licensed under the Sun Industry
+Standards Source License.
+
+This work also comes with the added permission that you may combine it with a
+work licensed under the Open Software License (any version) and distribute
+the resulting combined work, as long as you follow the requirements of the
+licences of this work in regard to all of the resulting combined work
+aside from the work licensed under the Open Software License.
+
+=======================================================
+Transitive Grace Period Public Licence ("TGPPL") v. 1.0
+=======================================================
+
+This Transitive Grace Period Public Licence (the "License") applies to any
+original work of authorship (the "Original Work") whose owner (the
+"Licensor") has placed the following licensing notice adjacent to the
+copyright notice for the Original Work:
+
+ *Licensed under the Transitive Grace Period Public Licence version 1.0*
+
+1. **Grant of Copyright License.** Licensor grants You a worldwide,
+ royalty-free, non-exclusive, sublicensable license, for the duration of
+ the copyright, to do the following:
+
+ a. to reproduce the Original Work in copies, either alone or as part of a
+ collective work;
+
+ b. to translate, adapt, alter, transform, modify, or arrange the Original
+ Work, thereby creating derivative works ("Derivative Works") based upon
+ the Original Work;
+
+ c. to distribute or communicate copies of the Original Work and Derivative
+ Works to the public, with the proviso that copies of Original Work or
+ Derivative Works that You distribute or communicate shall be licensed
+ under this Transitive Grace Period Public Licence no later than 12
+ months after You distributed or communicated said copies;
+
+ d. to perform the Original Work publicly; and
+
+ e. to display the Original Work publicly.
+
+2. **Grant of Patent License.** Licensor grants You a worldwide,
+ royalty-free, non-exclusive, sublicensable license, under patent claims
+ owned or controlled by the Licensor that are embodied in the Original
+ Work as furnished by the Licensor, for the duration of the patents, to
+ make, use, sell, offer for sale, have made, and import the Original Work
+ and Derivative Works.
+
+3. **Grant of Source Code License.** The term "Source Code" means the
+ preferred form of the Original Work for making modifications to it and
+ all available documentation describing how to modify the Original
+ Work. Licensor agrees to provide a machine-readable copy of the Source
+ Code of the Original Work along with each copy of the Original Work that
+ Licensor distributes. Licensor reserves the right to satisfy this
+ obligation by placing a machine-readable copy of the Source Code in an
+ information repository reasonably calculated to permit inexpensive and
+ convenient access by You for as long as Licensor continues to distribute
+ the Original Work.
+
+4. **Exclusions From License Grant.** Neither the names of Licensor, nor the
+ names of any contributors to the Original Work, nor any of their
+ trademarks or service marks, may be used to endorse or promote products
+ derived from this Original Work without express prior permission of the
+ Licensor. Except as expressly stated herein, nothing in this License
+ grants any license to Licensor's trademarks, copyrights, patents, trade
+ secrets or any other intellectual property. No patent license is granted
+ to make, use, sell, offer for sale, have made, or import embodiments of
+ any patent claims other than the licensed claims defined in Section 2. No
+ license is granted to the trademarks of Licensor even if such marks are
+ included in the Original Work. Nothing in this License shall be
+ interpreted to prohibit Licensor from licensing under terms different
+ from this License any Original Work that Licensor otherwise would have a
+ right to license.
+
+5. **External Deployment.** The term "External Deployment" means the use,
+ distribution, or communication of the Original Work or Derivative Works
+ in any way such that the Original Work or Derivative Works may be used by
+ anyone other than You, whether those works are distributed or
+ communicated to those persons or made available as an application
+ intended for use over a network. As an express condition for the grants
+ of license hereunder, You must treat any External Deployment by You of
+ the Original Work or a Derivative Work as a distribution under section
+ 1(c).
+
+6. **Attribution Rights.** You must retain, in the Source Code of any
+ Derivative Works that You create, all copyright, patent, or trademark
+ notices from the Source Code of the Original Work, as well as any notices
+ of licensing and any descriptive text identified therein as an
+ "Attribution Notice." You must cause the Source Code for any Derivative
+ Works that You create to carry a prominent Attribution Notice reasonably
+ calculated to inform recipients that You have modified the Original Work.
+
+7. **Warranty of Provenance and Disclaimer of Warranty.** Licensor warrants
+ that the copyright in and to the Original Work and the patent rights
+ granted herein by Licensor are owned by the Licensor or are sublicensed
+ to You under the terms of this License with the permission of the
+ contributor(s) of those copyrights and patent rights. Except as expressly
+ stated in the immediately preceding sentence, the Original Work is
+ provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY,
+ either express or implied, including, without limitation, the warranties
+ of non-infringement, merchantability or fitness for a particular
+ purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH
+ YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
+ License. No license to the Original Work is granted by this License
+ except under this disclaimer.
+
+8. **Limitation of Liability.** Under no circumstances and under no legal
+ theory, whether in tort (including negligence), contract, or otherwise,
+ shall the Licensor be liable to anyone for any indirect, special,
+ incidental, or consequential damages of any character arising as a result
+ of this License or the use of the Original Work including, without
+ limitation, damages for loss of goodwill, work stoppage, computer failure
+ or malfunction, or any and all other commercial damages or losses. This
+ limitation of liability shall not apply to the extent applicable law
+ prohibits such limitation.
+
+9. **Acceptance and Termination.** If, at any time, You expressly assented
+ to this License, that assent indicates your clear and irrevocable
+ acceptance of this License and all of its terms and conditions. If You
+ distribute or communicate copies of the Original Work or a Derivative
+ Work, You must make a reasonable effort under the circumstances to obtain
+ the express assent of recipients to the terms of this License. This
+ License conditions your rights to undertake the activities listed in
+ Section 1, including your right to create Derivative Works based upon the
+ Original Work, and doing so without honoring these terms and conditions
+ is prohibited by copyright law and international treaty. Nothing in this
+ License is intended to affect copyright exceptions and limitations
+ (including 'fair use' or 'fair dealing'). This License shall terminate
+ immediately and You may no longer exercise any of the rights granted to
+ You by this License upon your failure to honor the conditions in Section
+ 1(c).
+
+10. **Termination for Patent Action.** This License shall terminate
+ automatically and You may no longer exercise any of the rights granted to
+ You by this License as of the date You commence an action, including a
+ cross-claim or counterclaim, against Licensor or any licensee alleging
+ that the Original Work infringes a patent. This termination provision
+ shall not apply for an action alleging patent infringement by
+ combinations of the Original Work with other software or hardware.
+
+11. **Jurisdiction, Venue and Governing Law.** Any action or suit relating to
+ this License may be brought only in the courts of a jurisdiction wherein
+ the Licensor resides or in which Licensor conducts its primary business,
+ and under the laws of that jurisdiction excluding its conflict-of-law
+ provisions. The application of the United Nations Convention on Contracts
+ for the International Sale of Goods is expressly excluded. Any use of the
+ Original Work outside the scope of this License or after its termination
+ shall be subject to the requirements and penalties of copyright or patent
+ law in the appropriate jurisdiction. This section shall survive the
+ termination of this License.
+
+12. **Attorneys' Fees.** In any action to enforce the terms of this License
+ or seeking damages relating thereto, the prevailing party shall be
+ entitled to recover its costs and expenses, including, without
+ limitation, reasonable attorneys' fees and costs incurred in connection
+ with such action, including any appeal of such action. This section shall
+ survive the termination of this License.
+
+13. **Miscellaneous.** If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable.
+
+14. **Definition of "You" in This License.** "You" throughout this License,
+ whether in upper or lower case, means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License. For legal entities, "You" includes any entity that controls, is
+ controlled by, or is under common control with you. For purposes of this
+ definition, "control" means (i) the power, direct or indirect, to cause
+ the direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+15. **Right to Use.** You may use the Original Work in all ways not otherwise
+ restricted or conditioned by this License or by law, and Licensor
+ promises not to interfere with or be responsible for such uses by You.
+
+16. **Modification of This License.** This License is Copyright © 2007 Zooko
+ Wilcox-O'Hearn. Permission is granted to copy, distribute, or communicate
+ this License without modification. Nothing in this License permits You to
+ modify this License as applied to the Original Work or to Derivative
+ Works. However, You may modify the text of this License and copy,
+ distribute or communicate your modified version (the "Modified License")
+ and apply it to other original works of authorship subject to the
+ following conditions: (i) You may not indicate in any way that your
+ Modified License is the "Transitive Grace Period Public Licence" or
+ "TGPPL" and you may not use those names in the name of your Modified
+ License; and (ii) You must replace the notice specified in the first
+ paragraph above with the notice "Licensed under <insert your license name
+ here>" or with a notice of your own that is not confusingly similar to
+ the notice in this License.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index f4b99ac..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,28 +0,0 @@
-2012-03-13 Zooko Wilcox-O'Hearn <zooko@zooko.com>
-
- • 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)
-
-2009-09-15 Zooko Wilcox-O'Hearn <zooko@zooko.com>
-
- • 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)
-
-2009-07-27 Zooko Wilcox-O'Hearn <zooko@zooko.com>
-
- • release pycryptopp-0.5.16
- • setup.py, misc/: a few improvements to the build/packaging
diff --git a/MANIFEST.in b/MANIFEST.in
index 37ed49f..44d1921 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,5 @@
-include copyright COPYING.GPL COPYING.TGPPL.html ChangeLog NEWS.rst README.rst
-include COPYING.ed25519 README.ed25519.rst
+include copyright COPYING.GPL COPYING.TGPPL.rst COPYING.MIT.txt COPYING.SPL.txt NEWS.rst README.rst
+include README.ed25519.rst
include MANIFEST.in
include versioneer.py
include _doubleloadtester.cpp
diff --git a/NEWS.rst b/NEWS.rst
index f797344..6e564e2 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,20 +1,34 @@
-2011-01-16 -- pycryptopp v0.5.28
+2016-02-03 Zooko Wilcox <zookog@gmail.com>
- * 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
+ • release pycryptopp-0.7.1
+ • disable optimized assembly implementations by default (#85)
+ • tweaks to the benchmarking scripts
-2010-09-20 -- pycryptopp v0.5.25
+2012-03-13 Zooko Wilcox-O'Hearn <zooko@zooko.com>
- * 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
+ • 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-18 -- pycryptopp v0.5.20
+2009-09-15 Zooko Wilcox-O'Hearn <zooko@zooko.com>
- * 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.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)
+
+2009-07-27 Zooko Wilcox-O'Hearn <zooko@zooko.com>
+
+ • release pycryptopp-0.5.16
+ • setup.py, misc/: a few improvements to the build/packaging
diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index d308672..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,109 +0,0 @@
-Metadata-Version: 1.0
-Name: pycryptopp
-Version: 0.6.0.1206569328141510525648634803928199668821045408958
-Summary: Python wrappers for a few algorithms from the Crypto++ library
-Home-page: https://tahoe-lafs.org/trac/pycryptopp
-Author: Zooko Wilcox-O'Hearn
-Author-email: zooko@zooko.com
-License: GNU GPL
-Description: ===========================================================
- pycryptopp: a small number of good cryptography algorithms
- ===========================================================
-
- Introduction and Licence
- ========================
-
- pycryptopp is a python wrapper around a few algorithms from the Crypto++ and
- python-Ed25519 libraries.
-
- It lives at https://tahoe-lafs.org/trac/pycryptopp
-
- LICENCE
- -------
-
- You may use this package under the GNU General Public License, version 2 or,
- at your option, any later version. You may use this package under the
- Transitive Grace Period Public Licence, version 1.0 or, at your option, any
- later version. (You may choose to use this package under the terms of either
- licence, at your option.) See the file COPYING.GPL for the terms of the GNU
- General Public License, version 2. See the file COPYING.TGPPL.html for the
- terms of the Transitive Grace Period Public Licence, version 1.0.
-
- The Ed25519 code comes from the python-ed25519 distribution ¹_, for which the
- basic C code is in the public domain, and the Python bindings are under the
- MIT license. See COPYING.ed25519 for details.
-
- BUILDING
- --------
-
- To build it run "./setup.py build". To test it run "./setup.py test". To
- install it into your system run "./setup.py install". To create a binary
- package run "./setup.py bdist_egg".
-
- If "./setup.py test" doesn't print out "PASSED" and exit with exit code 0
- then there is something seriously wrong. Do not use this build of
- pycryptopp. Please report the error to the tahoe-dev mailing list ²_.
-
- DOCUMENTATION
- -------------
-
- The documentation is in the docstrings. From a command-line, use "pydoc
- pycryptopp", "pydoc pycryptopp.cipher", and so on. From within a Python
- interpreter use "help(pycryptopp)", "help(pycryptopp.cipher)",
- "help(pycryptopp.cipher.aes)" and so on.
-
- The documentation for pycryptopp.publickey.ed25519 is in README.ed25519,
- adapted from the upstream python-ed25519 library.
-
- CONTACT
- -------
-
- Please post to the tahoe-dev mailing list ²_ with comments about this
- package.
-
- BOOK REVIEW
- -----------
-
- If you are not already acquainted with how to use modern cryptography, buy a
- copy of Ferguson, Schneier, and Kohno "Cryptography Engineering" and read it.
- It is easy going and will increase your understanding greatly.
-
- ACKNOWLEDGEMENTS
- ----------------
-
- Thanks to Wei Dai and the contributors to Crypto++, Andrew M. Kuchling for
- his "pycrypto" library which inspired this one, Brian Warner for help on
- Python packaging questions, python-Ed25519, inspiration, and a million other
- things besides, Greg Hazel and Samuel Neves for Windows porting and fixing
- bugs, and Daniel J. Bernstein for Ed25519.
-
-
- Zooko Wilcox-O'Hearn
-
- Santa Clara, California, USA
-
- 2012-03-12
-
-
- .. _¹: https://github.com/warner/python-ed25519
- .. _²: https://tahoe-lafs.org/cgi-bin/mailman/listinfo/tahoe-dev
-
-Platform: UNKNOWN
-Classifier: Environment :: Console
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
-Classifier: License :: DFSG approved
-Classifier: License :: Other/Proprietary License
-Classifier: Intended Audience :: Developers
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Operating System :: Unix
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Natural Language :: English
-Classifier: Programming Language :: C
-Classifier: Programming Language :: C++
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.4
-Classifier: Programming Language :: Python :: 2.5
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Topic :: Software Development :: Libraries
diff --git a/README.ed25519.rst b/README.ed25519.rst
index 2216233..b95cf2f 100644
--- a/README.ed25519.rst
+++ b/README.ed25519.rst
@@ -1,20 +1,21 @@
+
+
=====================================================
Python Bindings to Ed25519 Digital Signature System
=====================================================
This package provides python bindings to a C implementation of the Ed25519
-public-key signature system [1]_. The C code is copied from the SUPERCOP
-benchmark suite [2]_, using the portable "ref" implementation (not the
+public-key signature system ¹_. The C code is copied from the SUPERCOP
+benchmark suite ²_, using the portable "ref" implementation (not the
high-performance assembly code), and is very similar to the copy in the NaCl
-library [3]_. The C code is in the public domain [4]_. This python binding is
-released under the MIT license [5]_.
+library ³_.
With this library, you can quickly (2ms) create signing+verifying keypairs,
derive a verifying key from a signing key, sign messages, and verify the
signatures. The keys and signatures are very short, making them easy to
handle and incorporate into other protocols. All known attacks take at least
-2^128 operations, providing the same security level as AES-128, NIST P-256,
-and RSA-3072.
+2¹²⁸ operations, providing a security level comparable to AES-128, NIST
+P-256, and RSA-3248.
Speed and Key Sizes
@@ -130,8 +131,6 @@ The complete API is summarized here::
footnotes
---------
-.. [1] http://ed25519.cr.yp.to/
-.. [2] http://bench.cr.yp.to/supercop.html
-.. [3] http://nacl.cr.yp.to/
-.. [4] http://ed25519.cr.yp.to/software.html "Copyrights"
-.. [5] LICENSE, included in this distribution
+.. _¹: http://ed25519.cr.yp.to/
+.. _²: http://bench.cr.yp.to/supercop.html
+.. _³: http://nacl.cr.yp.to/
diff --git a/README.rst b/README.rst
index 27a3995..2f8bb16 100644
--- a/README.rst
+++ b/README.rst
@@ -1,3 +1,5 @@
+
+
===========================================================
pycryptopp: a small number of good cryptography algorithms
===========================================================
@@ -5,10 +7,27 @@
Introduction and Licence
========================
-pycryptopp is a python wrapper around a few algorithms from the Crypto++ and
-python-Ed25519 libraries.
+Pycryptopp is a collection of Python interfaces to a few good crypto
+algorithms. It lives at https://tahoe-lafs.org/trac/pycryptopp
+
+RECOMMENDED algorithms:
+
+• XSalsa20 ; from the Crypto++ library ; see pycryptopp.cipher.xsalsa20
+• Ed25519 ; from the supercop library ; see pycryptopp.publickey.ed25519
+
+DEPRECATED algorithms:
-It lives at https://tahoe-lafs.org/trac/pycryptopp
+The maintainers of pycryptopp intend to stop supporting these soon. Please
+migrate away from depending on pycryptopp's implementation of these
+algorithms, or else write to us and offer some inducement to continue
+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
LICENCE
-------
@@ -16,26 +35,34 @@ LICENCE
You may use this package under the GNU General Public License, version 2 or,
at your option, any later version. You may use this package under the
Transitive Grace Period Public Licence, version 1.0 or, at your option, any
-later version. (You may choose to use this package under the terms of either
-licence, at your option.) See the file COPYING.GPL for the terms of the GNU
-General Public License, version 2. See the file COPYING.TGPPL.html for the
-terms of the Transitive Grace Period Public Licence, version 1.0.
+later version. You may use this package under the MIT License. You may use
+this package under the Simple Permissive Licence.
+
+(You may choose to use this package under the terms of any of these licences,
+at your option.)
-The Ed25519 code comes from the python-ed25519 distribution ¹_, for which the
-basic C code is in the public domain, and the Python bindings are under the
-MIT license. See COPYING.ed25519 for details.
+See the file COPYING.GPL for the terms of the GNU General Public License,
+version 2. See the file COPYING.TGPPL.rst for the terms of the Transitive
+Grace Period Public Licence, version 1.0. See the file COPYING.MIT.txt for
+the terms of the MIT License. See the file COPYING.SPL.txt for the terms of
+the Simple Permissive Licence.
BUILDING
--------
-To build it run "./setup.py build". To test it run "./setup.py test". To
-install it into your system run "./setup.py install". To create a binary
-package run "./setup.py bdist_egg".
+To build it run "python setup.py build". To test it run "python setup.py
+test". To install it into your system run "python setup.py install". To
+create a binary package run "python setup.py bdist_egg".
-If "./setup.py test" doesn't print out "PASSED" and exit with exit code 0
-then there is something seriously wrong. Do not use this build of
+If "python setup.py test" doesn't print out "PASSED" and exit with exit
+code 0 then there is something seriously wrong. Do not use this build of
pycryptopp. Please report the error to the tahoe-dev mailing list ²_.
+To see some simple benchmarks run "python setup.py bench". If the "pyutil"
+library is installed then the benchmarks will include mean, best, worst, and
+quartiles of wall-clock time, else they will just report the mean wall-clock
+time per operation.
+
DOCUMENTATION
-------------
@@ -44,7 +71,7 @@ pycryptopp", "pydoc pycryptopp.cipher", and so on. From within a Python
interpreter use "help(pycryptopp)", "help(pycryptopp.cipher)",
"help(pycryptopp.cipher.aes)" and so on.
-The documentation for pycryptopp.publickey.ed25519 is in README.ed25519,
+The documentation for pycryptopp.publickey.ed25519 is in README.ed25519.rst,
adapted from the upstream python-ed25519 library.
CONTACT
@@ -56,25 +83,27 @@ package.
BOOK REVIEW
-----------
-If you are not already acquainted with how to use modern cryptography, buy a
-copy of Ferguson, Schneier, and Kohno "Cryptography Engineering" and read it.
-It is easy going and will increase your understanding greatly.
+If you are not already acquainted with how to use modern cryptography, read
+Ferguson, Schneier, and Kohno “Cryptography Engineering”. It is easy going
+and will increase your understanding greatly.
ACKNOWLEDGEMENTS
----------------
-Thanks to Wei Dai and the contributors to Crypto++, Andrew M. Kuchling for
-his "pycrypto" library which inspired this one, Brian Warner for help on
-Python packaging questions, python-Ed25519, inspiration, and a million other
-things besides, Greg Hazel and Samuel Neves for Windows porting and fixing
-bugs, and Daniel J. Bernstein for Ed25519.
+Thanks to Wei Dai, Jeffrey Walton, and the other contributors to
+Crypto++, Andrew M. Kuchling for his "pycrypto" library which inspired
+this one, Brian Warner for help on Python packaging questions,
+python-Ed25519, inspiration, and a million other things besides, Greg
+Hazel and Samuel Neves for Windows porting and fixing bugs, Daira
+Hopwood for helping maintain pycryptopp, and Daniel J. Bernstein for
+Ed25519.
-Zooko Wilcox-O'Hearn
+Zooko Wilcox
-Santa Clara, California, USA
+Berlin, Germany
-2012-03-12
+2016-01-03
.. _¹: https://github.com/warner/python-ed25519
diff --git a/copyright b/copyright
index d59b0f5..76be0b0 100644
--- a/copyright
+++ b/copyright
@@ -1,20 +1,26 @@
This package was debianized by Zooko O'Whielacronx zooko@zooko.com on
Tue, 16 July 2009 23:30:00 +0000.
-It was originally downloaded from http://tahoe-lafs/trac/pycryptopp
+It was originally downloaded from https://tahoe-lafs.org/trac/pycryptopp
Upstream Author: Zooko O'Whielacronx <zooko@zooko.com>
Copyright:
-You may use this package under the GNU General Public License, version
-2 or, at your option, any later version. You may use this package
-under the Transitive Grace Period Public Licence, version 1.0 or, at
-your option, any later version. (You may choose to use this package
-under the terms of either licence, at your option.) See the file
-COPYING.GPL for the terms of the GNU General Public License, version 2.
-See the file COPYING.TGPPL.html for the terms of the Transitive Grace
-Period Public Licence, version 1.0.
+You may use this package under the GNU General Public License, version 2 or,
+at your option, any later version. You may use this package under the
+Transitive Grace Period Public Licence, version 1.0 or, at your option, any
+later version. You may use this package under the MIT License. You may use
+this package under the Simple Permissive Licence.
+
+(You may choose to use this package under the terms of any of these licences,
+at your option.)
+
+See the file COPYING.GPL for the terms of the GNU General Public License,
+version 2. See the file COPYING.TGPPL.rst for the terms of the Transitive
+Grace Period Public Licence, version 1.0. See the file COPYING.MIT.txt for
+the terms of the MIT License. See the file COPYING.SPL.txt for the terms of
+the Simple Permissive Licence.
The following licensing text applies to a subset of the Crypto++ source code
which is included in the pycryptopp source tree under the "src-cryptopp"
diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py
index 2733e78..5011a7b 100644
--- a/misc/build_helpers/show-tool-versions.py
+++ b/misc/build_helpers/show-tool-versions.py
@@ -149,8 +149,11 @@ print_as_ver()
print_setuptools_ver()
+print_py_pkg_ver('pyutil')
print_py_pkg_ver('coverage')
print_py_pkg_ver('pyflakes')
print_py_pkg_ver('Twisted', 'twisted')
print_py_pkg_ver('TwistedCore', 'twisted.python')
print_py_pkg_ver('pyOpenSSL', 'OpenSSL')
+print_py_pkg_ver('pycryptopp')
+print_py_pkg_ver('crpyto')
diff --git a/misc/coding_helpers/python.supp b/misc/coding_helpers/python.supp
index 102e2ec..1a9a45e 100644
--- a/misc/coding_helpers/python.supp
+++ b/misc/coding_helpers/python.supp
@@ -64,6 +64,26 @@
fun:PyObject_Realloc.part.0.20700
}
+# generated on luther sid
+# e.g. https://tahoe-lafs.org/buildbot-pycryptopp/builders/luther%20sid/builds/116/steps/double%20load%20valgrind/logs/valgrind
+{
+ luther sid addr4 realloc
+ Memcheck:Addr4
+ fun:PyObject_Realloc.part.0.20856
+}
+
+{
+ luther sid cond realloc
+ Memcheck:Cond
+ fun:PyObject_Realloc.part.0.20856
+}
+
+{
+ luther sid value4 realloc
+ Memcheck:Value4
+ fun:PyObject_Realloc.part.0.20856
+}
+
# 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()
diff --git a/pycryptopp.egg-info/PKG-INFO b/pycryptopp.egg-info/PKG-INFO
deleted file mode 100644
index d308672..0000000
--- a/pycryptopp.egg-info/PKG-INFO
+++ /dev/null
@@ -1,109 +0,0 @@
-Metadata-Version: 1.0
-Name: pycryptopp
-Version: 0.6.0.1206569328141510525648634803928199668821045408958
-Summary: Python wrappers for a few algorithms from the Crypto++ library
-Home-page: https://tahoe-lafs.org/trac/pycryptopp
-Author: Zooko Wilcox-O'Hearn
-Author-email: zooko@zooko.com
-License: GNU GPL
-Description: ===========================================================
- pycryptopp: a small number of good cryptography algorithms
- ===========================================================
-
- Introduction and Licence
- ========================
-
- pycryptopp is a python wrapper around a few algorithms from the Crypto++ and
- python-Ed25519 libraries.
-
- It lives at https://tahoe-lafs.org/trac/pycryptopp
-
- LICENCE
- -------
-
- You may use this package under the GNU General Public License, version 2 or,
- at your option, any later version. You may use this package under the
- Transitive Grace Period Public Licence, version 1.0 or, at your option, any
- later version. (You may choose to use this package under the terms of either
- licence, at your option.) See the file COPYING.GPL for the terms of the GNU
- General Public License, version 2. See the file COPYING.TGPPL.html for the
- terms of the Transitive Grace Period Public Licence, version 1.0.
-
- The Ed25519 code comes from the python-ed25519 distribution ¹_, for which the
- basic C code is in the public domain, and the Python bindings are under the
- MIT license. See COPYING.ed25519 for details.
-
- BUILDING
- --------
-
- To build it run "./setup.py build". To test it run "./setup.py test". To
- install it into your system run "./setup.py install". To create a binary
- package run "./setup.py bdist_egg".
-
- If "./setup.py test" doesn't print out "PASSED" and exit with exit code 0
- then there is something seriously wrong. Do not use this build of
- pycryptopp. Please report the error to the tahoe-dev mailing list ²_.
-
- DOCUMENTATION
- -------------
-
- The documentation is in the docstrings. From a command-line, use "pydoc
- pycryptopp", "pydoc pycryptopp.cipher", and so on. From within a Python
- interpreter use "help(pycryptopp)", "help(pycryptopp.cipher)",
- "help(pycryptopp.cipher.aes)" and so on.
-
- The documentation for pycryptopp.publickey.ed25519 is in README.ed25519,
- adapted from the upstream python-ed25519 library.
-
- CONTACT
- -------
-
- Please post to the tahoe-dev mailing list ²_ with comments about this
- package.
-
- BOOK REVIEW
- -----------
-
- If you are not already acquainted with how to use modern cryptography, buy a
- copy of Ferguson, Schneier, and Kohno "Cryptography Engineering" and read it.
- It is easy going and will increase your understanding greatly.
-
- ACKNOWLEDGEMENTS
- ----------------
-
- Thanks to Wei Dai and the contributors to Crypto++, Andrew M. Kuchling for
- his "pycrypto" library which inspired this one, Brian Warner for help on
- Python packaging questions, python-Ed25519, inspiration, and a million other
- things besides, Greg Hazel and Samuel Neves for Windows porting and fixing
- bugs, and Daniel J. Bernstein for Ed25519.
-
-
- Zooko Wilcox-O'Hearn
-
- Santa Clara, California, USA
-
- 2012-03-12
-
-
- .. _¹: https://github.com/warner/python-ed25519
- .. _²: https://tahoe-lafs.org/cgi-bin/mailman/listinfo/tahoe-dev
-
-Platform: UNKNOWN
-Classifier: Environment :: Console
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
-Classifier: License :: DFSG approved
-Classifier: License :: Other/Proprietary License
-Classifier: Intended Audience :: Developers
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Operating System :: Unix
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Natural Language :: English
-Classifier: Programming Language :: C
-Classifier: Programming Language :: C++
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.4
-Classifier: Programming Language :: Python :: 2.5
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Topic :: Software Development :: Libraries
diff --git a/pycryptopp.egg-info/SOURCES.txt b/pycryptopp.egg-info/SOURCES.txt
deleted file mode 100644
index c4b22ec..0000000
--- a/pycryptopp.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,257 +0,0 @@
-COPYING.GPL
-COPYING.TGPPL.html
-COPYING.ed25519
-ChangeLog
-MANIFEST.in
-NEWS.rst
-README.ed25519.rst
-README.rst
-_doubleloadtester.cpp
-copyright
-setup.cfg
-setup.py
-versioneer.py
-misc/aside/test-sha256.cpp
-misc/build_helpers/show-tool-versions.py
-misc/coding_helpers/python.supp
-misc/dependencies/setuptools-0.6c14dev.egg
-pycryptopp.egg-info/PKG-INFO
-pycryptopp.egg-info/SOURCES.txt
-pycryptopp.egg-info/dependency_links.txt
-pycryptopp.egg-info/not-zip-safe
-pycryptopp.egg-info/requires.txt
-pycryptopp.egg-info/stdeb.cfg
-pycryptopp.egg-info/top_level.txt
-src-cryptopp/Doxyfile
-src-cryptopp/GNUmakefile
-src-cryptopp/License.txt
-src-cryptopp/Readme.txt
-src-cryptopp/adhoc.cpp.proto
-src-cryptopp/aes.h
-src-cryptopp/algebra.cpp
-src-cryptopp/algebra.h
-src-cryptopp/algparam.cpp
-src-cryptopp/algparam.h
-src-cryptopp/argnames.h
-src-cryptopp/asn.cpp
-src-cryptopp/asn.h
-src-cryptopp/authenc.h
-src-cryptopp/basecode.cpp
-src-cryptopp/basecode.h
-src-cryptopp/cbcmac.h
-src-cryptopp/ccm.h
-src-cryptopp/channels.h
-src-cryptopp/cmac.h
-src-cryptopp/config.h
-src-cryptopp/cpu.cpp
-src-cryptopp/cpu.h
-src-cryptopp/cryptdll.dsp
-src-cryptopp/cryptdll.vcproj
-src-cryptopp/cryptest.dsp
-src-cryptopp/cryptest.dsw
-src-cryptopp/cryptest.sln
-src-cryptopp/cryptest.vcproj
-src-cryptopp/cryptest_bds.bdsgroup
-src-cryptopp/cryptest_bds.bdsproj
-src-cryptopp/cryptest_bds.bpf
-src-cryptopp/cryptlib.cpp
-src-cryptopp/cryptlib.dsp
-src-cryptopp/cryptlib.h
-src-cryptopp/cryptlib.vcproj
-src-cryptopp/cryptlib_bds.bdsproj
-src-cryptopp/cryptopp.rc
-src-cryptopp/des.cpp
-src-cryptopp/des.h
-src-cryptopp/dessp.cpp
-src-cryptopp/dh.h
-src-cryptopp/dll.cpp
-src-cryptopp/dll.h
-src-cryptopp/dlltest.dsp
-src-cryptopp/dlltest.vcproj
-src-cryptopp/dsa.cpp
-src-cryptopp/dsa.h
-src-cryptopp/ec2n.cpp
-src-cryptopp/ec2n.h
-src-cryptopp/eccrypto.cpp
-src-cryptopp/eccrypto.h
-src-cryptopp/ecp.cpp
-src-cryptopp/ecp.h
-src-cryptopp/emsa2.h
-src-cryptopp/eprecomp.cpp
-src-cryptopp/eprecomp.h
-src-cryptopp/extraversion.h
-src-cryptopp/files.h
-src-cryptopp/filters.cpp
-src-cryptopp/filters.h
-src-cryptopp/fips140.cpp
-src-cryptopp/fips140.h
-src-cryptopp/fltrimpl.h
-src-cryptopp/gcm.h
-src-cryptopp/gf2n.cpp
-src-cryptopp/gf2n.h
-src-cryptopp/gfpcrypt.cpp
-src-cryptopp/gfpcrypt.h
-src-cryptopp/hex.cpp
-src-cryptopp/hex.h
-src-cryptopp/hmac.cpp
-src-cryptopp/hmac.h
-src-cryptopp/integer.cpp
-src-cryptopp/integer.h
-src-cryptopp/iterhash.cpp
-src-cryptopp/iterhash.h
-src-cryptopp/misc.cpp
-src-cryptopp/misc.h
-src-cryptopp/modarith.h
-src-cryptopp/modes.cpp
-src-cryptopp/modes.h
-src-cryptopp/modexppc.h
-src-cryptopp/mqueue.cpp
-src-cryptopp/mqueue.h
-src-cryptopp/mqv.h
-src-cryptopp/nbtheory.cpp
-src-cryptopp/nbtheory.h
-src-cryptopp/oaep.cpp
-src-cryptopp/oaep.h
-src-cryptopp/oids.h
-src-cryptopp/osrng.cpp
-src-cryptopp/osrng.h
-src-cryptopp/pch.h
-src-cryptopp/pkcspad.cpp
-src-cryptopp/pkcspad.h
-src-cryptopp/pssr.cpp
-src-cryptopp/pssr.h
-src-cryptopp/pubkey.cpp
-src-cryptopp/pubkey.h
-src-cryptopp/queue.cpp
-src-cryptopp/queue.h
-src-cryptopp/randpool.cpp
-src-cryptopp/randpool.h
-src-cryptopp/rdtables.cpp
-src-cryptopp/rijndael.cpp
-src-cryptopp/rijndael.h
-src-cryptopp/rng.cpp
-src-cryptopp/rng.h
-src-cryptopp/rsa.cpp
-src-cryptopp/rsa.h
-src-cryptopp/rw.h
-src-cryptopp/salsa.cpp
-src-cryptopp/salsa.h
-src-cryptopp/secblock.h
-src-cryptopp/seckey.h
-src-cryptopp/serpent.cpp
-src-cryptopp/serpent.h
-src-cryptopp/serpentp.h
-src-cryptopp/sha.cpp
-src-cryptopp/sha.h
-src-cryptopp/simple.h
-src-cryptopp/skipjack.h
-src-cryptopp/smartptr.h
-src-cryptopp/sosemanuk.cpp
-src-cryptopp/sosemanuk.h
-src-cryptopp/stdcpp.h
-src-cryptopp/strciphr.cpp
-src-cryptopp/strciphr.h
-src-cryptopp/tiger.cpp
-src-cryptopp/tiger.h
-src-cryptopp/tigertab.cpp
-src-cryptopp/trdlocal.h
-src-cryptopp/words.h
-src-cryptopp/x64dll.asm
-src-cryptopp/x64masm.asm
-src-cryptopp/TestVectors/Readme.txt
-src-cryptopp/TestVectors/aes.txt
-src-cryptopp/TestVectors/all.txt
-src-cryptopp/TestVectors/camellia.txt
-src-cryptopp/TestVectors/ccm.txt
-src-cryptopp/TestVectors/cmac.txt
-src-cryptopp/TestVectors/dlies.txt
-src-cryptopp/TestVectors/dsa.txt
-src-cryptopp/TestVectors/dsa_1363.txt
-src-cryptopp/TestVectors/eax.txt
-src-cryptopp/TestVectors/esign.txt
-src-cryptopp/TestVectors/gcm.txt
-src-cryptopp/TestVectors/hmac.txt
-src-cryptopp/TestVectors/mars.txt
-src-cryptopp/TestVectors/nr.txt
-src-cryptopp/TestVectors/panama.txt
-src-cryptopp/TestVectors/rsa_oaep.txt
-src-cryptopp/TestVectors/rsa_pkcs1_1_5.txt
-src-cryptopp/TestVectors/rsa_pss.txt
-src-cryptopp/TestVectors/rw.txt
-src-cryptopp/TestVectors/salsa.txt
-src-cryptopp/TestVectors/seal.txt
-src-cryptopp/TestVectors/seed.txt
-src-cryptopp/TestVectors/sha.txt
-src-cryptopp/TestVectors/shacal2.txt
-src-cryptopp/TestVectors/sosemanuk.txt
-src-cryptopp/TestVectors/tea.txt
-src-cryptopp/TestVectors/ttmac.txt
-src-cryptopp/TestVectors/vmac.txt
-src-cryptopp/TestVectors/whrlpool.txt
-src-ed25519/glue/ed25519module.c
-src-ed25519/supercop-ref/Makefile
-src-ed25519/supercop-ref/api.h
-src-ed25519/supercop-ref/crypto_int32.h
-src-ed25519/supercop-ref/crypto_sign.h
-src-ed25519/supercop-ref/crypto_uint32.h
-src-ed25519/supercop-ref/crypto_verify_32.h
-src-ed25519/supercop-ref/ed25519.c
-src-ed25519/supercop-ref/fe25519.c
-src-ed25519/supercop-ref/fe25519.h
-src-ed25519/supercop-ref/ge25519.c
-src-ed25519/supercop-ref/ge25519.h
-src-ed25519/supercop-ref/ge25519_base.data
-src-ed25519/supercop-ref/sc25519.c
-src-ed25519/supercop-ref/sc25519.h
-src-ed25519/supercop-ref/sha512-blocks.c
-src-ed25519/supercop-ref/sha512-hash.c
-src-ed25519/supercop-ref/sha512.h
-src-ed25519/supercop-ref/test.c
-src-ed25519/supercop-ref/verify.c
-src/pycryptopp/__init__.py
-src/pycryptopp/_pycryptoppmodule.cpp
-src/pycryptopp/_version.py
-src/pycryptopp/cipher/__init__.py
-src/pycryptopp/cipher/aes.py
-src/pycryptopp/cipher/aesmodule.cpp
-src/pycryptopp/cipher/aesmodule.hpp
-src/pycryptopp/cipher/xsalsa20.py
-src/pycryptopp/cipher/xsalsa20module.cpp
-src/pycryptopp/cipher/xsalsa20module.hpp
-src/pycryptopp/hash/__init__.py
-src/pycryptopp/hash/sha256.py
-src/pycryptopp/hash/sha256module.cpp
-src/pycryptopp/hash/sha256module.hpp
-src/pycryptopp/publickey/__init__.py
-src/pycryptopp/publickey/ecdsa.py
-src/pycryptopp/publickey/ecdsamodule.cpp
-src/pycryptopp/publickey/ecdsamodule.hpp
-src/pycryptopp/publickey/rsa.py
-src/pycryptopp/publickey/rsamodule.cpp
-src/pycryptopp/publickey/rsamodule.hpp
-src/pycryptopp/publickey/ed25519/__init__.py
-src/pycryptopp/publickey/ed25519/_version.py
-src/pycryptopp/publickey/ed25519/keys.py
-src/pycryptopp/test/__init__.py
-src/pycryptopp/test/test_aes.py
-src/pycryptopp/test/test_ecdsa.py
-src/pycryptopp/test/test_ed25519.py
-src/pycryptopp/test/test_ed25519_kat.py
-src/pycryptopp/test/test_from_Nikratio.py
-src/pycryptopp/test/test_rsa.py
-src/pycryptopp/test/test_sha256.py
-src/pycryptopp/test/test_xsalsa20.py
-src/pycryptopp/testvectors/SHA256LongMsg.txt
-src/pycryptopp/testvectors/SHA256Monte.txt
-src/pycryptopp/testvectors/SHA256ShortMsg.txt
-src/pycryptopp/testvectors/kat-ed25519-short.txt
-src/pycryptopp/testvectors/kat-ed25519.txt
-src/pycryptopp/testvectors/xsalsa20.txt
-src/pycryptopp/testvectors/KAT_AES/ECBGFSbox128e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBGFSbox256e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBKeySbox128e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBKeySbox256e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBVarKey128e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBVarKey256e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBVarTxt128e.txt
-src/pycryptopp/testvectors/KAT_AES/ECBVarTxt256e.txt \ No newline at end of file
diff --git a/pycryptopp.egg-info/dependency_links.txt b/pycryptopp.egg-info/dependency_links.txt
deleted file mode 100644
index 8b13789..0000000
--- a/pycryptopp.egg-info/dependency_links.txt
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/pycryptopp.egg-info/not-zip-safe b/pycryptopp.egg-info/not-zip-safe
deleted file mode 100644
index 8b13789..0000000
--- a/pycryptopp.egg-info/not-zip-safe
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/pycryptopp.egg-info/requires.txt b/pycryptopp.egg-info/requires.txt
deleted file mode 100644
index 9317ea8..0000000
--- a/pycryptopp.egg-info/requires.txt
+++ /dev/null
@@ -1 +0,0 @@
-setuptools >= 0.6a9 \ No newline at end of file
diff --git a/pycryptopp.egg-info/top_level.txt b/pycryptopp.egg-info/top_level.txt
deleted file mode 100644
index 002d4ed..0000000
--- a/pycryptopp.egg-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-pycryptopp
diff --git a/setup.cfg b/setup.cfg
index 89482e3..5dd8c60 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,10 @@
[easy_install]
-zip_ok = False
+# pycryptopp actually does work at least as well as any package
+# works when zipped, but zipping eggs causes various problems
+# (http://bugs.python.org/setuptools/issue33 ), and generally makes it
+# harder for people to get at the source code, and doesn't actually
+# provide any benefits that I am aware of.
+zip_ok=False
[aliases]
build = build
@@ -9,9 +14,3 @@ install = build install
bdist_egg = build bdist_egg
trial = build trial
sdist_dsc = build sdist_dsc
-
-[egg_info]
-tag_build =
-tag_date = 0
-tag_svn_revision = 0
-
diff --git a/setup.py b/setup.py
index 34143d5..e4fb8b4 100644
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,11 @@
-#!/usr/bin/env python
# -*- 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
@@ -63,7 +62,7 @@ extra_srcs=[] # This is for Crypto++ .cpp files if they are needed.
#
# Fix the build on OpenBSD
-# http://tahoe-lafs/trac/pycryptopp/ticket/32
+# https://tahoe-lafs/trac/pycryptopp/ticket/32
#
if 'openbsd' in platform.system().lower():
extra_link_args.append("-fpic")
@@ -107,28 +106,14 @@ if DISABLE_EMBEDDED_CRYPTOPP:
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",
@@ -138,39 +123,10 @@ else:
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.
"License :: DFSG approved",
- "License :: Other/Proprietary License",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
@@ -180,8 +136,6 @@ trove_classifiers=[
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.4",
- "Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Software Development :: Libraries",
@@ -233,9 +187,17 @@ if 'flakes' in sys.argv[1:]:
if "sdist_dsc" in sys.argv:
setup_requires.append('stdeb')
-data_fnames=['COPYING.GPL', 'COPYING.TGPPL.html', 'README.rst']
+data_fnames=['COPYING.GPL', 'COPYING.TGPPL.rst', 'COPYING.MIT.txt', 'COPYING.SPL.txt', 'README.rst']
readmetext = open('README.rst').read()
+if readmetext[:3] == '\xef\xbb\xbf':
+ # utf-8 "BOM"
+ readmetext = readmetext[3:]
+
+try:
+ readmetext = readmetext.decode('utf-8')
+except UnicodeDecodeError:
+ pass
# In case we are building for a .deb with stdeb's sdist_dsc command, we put the
# docs in "share/doc/pycryptopp".
@@ -404,33 +366,58 @@ class Test(Command):
sys.exit(not result.wasSuccessful())
commands["test"] = Test
-setup(name=PKG,
- version=version,
- description='Python wrappers for a few algorithms from the Crypto++ library',
- long_description=readmetext,
- author='Zooko Wilcox-O\'Hearn',
- author_email='zooko@zooko.com',
- url='https://tahoe-lafs.org/trac/' + PKG,
- license='GNU GPL', # see README.rst for details -- there is also an alternative licence
- packages=["pycryptopp",
- "pycryptopp.cipher",
- "pycryptopp.hash",
- "pycryptopp.publickey",
- "pycryptopp.publickey.ed25519",
- "pycryptopp.test",
- ],
- include_package_data=True,
- exclude_package_data={
- '': [ '*.cpp', '*.hpp', ]
- },
- data_files=data_files,
- package_dir={"pycryptopp": "src/pycryptopp"},
- setup_requires=setup_requires,
- install_requires=install_requires,
- dependency_links=dependency_links,
- classifiers=trove_classifiers,
- ext_modules=ext_modules,
- test_suite=PKG+".test",
- zip_safe=False, # I prefer unzipped for easier access.
- cmdclass=commands,
- )
+class Bench(Command):
+ description = "run benchmarks"
+ user_options = []
+ def initialize_options(self):
+ pass
+ def finalize_options(self):
+ pass
+ def setup_path(self):
+ # copied from distutils/command/build.py
+ self.plat_name = get_platform()
+ plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3])
+ self.build_lib = os.path.join("build", "lib"+plat_specifier)
+ sys.path.insert(0, self.build_lib)
+ def run(self):
+ self.setup_path()
+ from pycryptopp.bench import bench_algs
+ bench_algs.bench(MAXTIME=1.0) # Requires pyutil ≤ 1.9.7
+commands["bench"] = Bench
+
+def _setup(longdescription):
+ setup(name=PKG,
+ version=version,
+ description='Python wrappers for a few algorithms from the Crypto++ library',
+ long_description=longdescription,
+ author='Zooko Wilcox',
+ author_email='zookog@gmail.com',
+ url='https://tahoe-lafs.org/trac/' + PKG,
+ license='GNU GPL', # see README.rst for details -- there is also an alternative licence
+ packages=["pycryptopp",
+ "pycryptopp.cipher",
+ "pycryptopp.hash",
+ "pycryptopp.publickey",
+ "pycryptopp.publickey.ed25519",
+ "pycryptopp.test",
+ ],
+ include_package_data=True,
+ exclude_package_data={
+ '': [ '*.cpp', '*.hpp', ]
+ },
+ data_files=data_files,
+ package_dir={"pycryptopp": "src/pycryptopp"},
+ setup_requires=setup_requires,
+ install_requires=install_requires,
+ dependency_links=dependency_links,
+ classifiers=trove_classifiers,
+ ext_modules=ext_modules,
+ test_suite=PKG+".test",
+ zip_safe=False, # I prefer unzipped for easier access.
+ cmdclass=commands,
+ )
+
+try:
+ _setup(readmetext)
+except UnicodeEncodeError:
+ _setup(repr(readmetext))
diff --git a/src-cryptopp/extraversion.h b/src-cryptopp/extraversion.h
deleted file mode 100644
index 4d31a23..0000000
--- a/src-cryptopp/extraversion.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-/* This _version.py is generated from git metadata by the pycryptopp
- * setup.py. The main version number is taken from the most recent release
- * tag. If some patches have been added since the last release, this will
- * have a -NN "build number" suffix, or else a -rNN "revision number" suffix.
- */
-
-#define CRYPTOPP_EXTRA_VERSION "pycryptopp-0.6.0.1206569328141510525648634803928199668821045408958"
diff --git a/src/pycryptopp/_version.py b/src/pycryptopp/_version.py
deleted file mode 100644
index c5c437f..0000000
--- a/src/pycryptopp/_version.py
+++ /dev/null
@@ -1,8 +0,0 @@
-
-# This is the version of this tree, as created by pycryptopp's setup.py from the
-# git information: the main version number is taken from the most recent
-# release tag. If some patches have been added since the last release, this
-# will have a -NN "build number" suffix, followed by -gXXX "revid" suffix.
-
-__pkgname__ = "pycryptopp"
-__version__ = "0.6.0.1206569328141510525648634803928199668821045408958"
diff --git a/src/pycryptopp/bench/__init__.py b/src/pycryptopp/bench/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/pycryptopp/bench/__init__.py
diff --git a/src/pycryptopp/bench/bench_algs.py b/src/pycryptopp/bench/bench_algs.py
new file mode 100644
index 0000000..a896d2b
--- /dev/null
+++ b/src/pycryptopp/bench/bench_algs.py
@@ -0,0 +1,9 @@
+import bench_sigs, bench_ciphers, bench_hashes
+
+def bench(MAXTIME=10.0):
+ bench_sigs.bench(MAXTIME)
+ bench_ciphers.bench(MAXTIME)
+ bench_hashes.bench(MAXTIME)
+
+if __name__ == '__main__':
+ bench()
diff --git a/src/pycryptopp/bench/bench_ciphers.py b/src/pycryptopp/bench/bench_ciphers.py
new file mode 100644
index 0000000..bb9a160
--- /dev/null
+++ b/src/pycryptopp/bench/bench_ciphers.py
@@ -0,0 +1,45 @@
+from pycryptopp.cipher import aes, xsalsa20
+
+from common import insecurerandstr, rep_bench
+
+UNITS_PER_SECOND = 10**9
+
+class BenchCrypt(object):
+ def __init__(self, klass, keysize):
+ self.klass = klass
+ self.keysize = keysize
+
+ def __repr__(self):
+ return "<%s-%d>" % (self.klass.__name__, self.keysize*8)
+
+ def crypt_init(self, N):
+ self.msg = insecurerandstr(N)
+ self.key = insecurerandstr(self.keysize)
+
+ def crypt(self, N):
+ cryptor = self.klass(self.key)
+ cryptor.process(self.msg)
+
+def bench_ciphers(MAXTIME):
+ for (klass, keysize) in [
+ (aes.AES, 16),
+ (aes.AES, 32),
+ (xsalsa20.XSalsa20, 32),
+ ]:
+ ob = BenchCrypt(klass, keysize)
+ print ob
+ for (legend, size) in [
+ ("large (%d B)", 10**7),
+ ]:
+ print legend % size
+ rep_bench(ob.crypt, size, UNITS_PER_SECOND=UNITS_PER_SECOND, MAXTIME=MAXTIME, MAXREPS=100, initfunc=ob.crypt_init)
+ print
+
+ print "nanoseconds per byte crypted"
+ print
+
+def bench(MAXTIME=10.0):
+ bench_ciphers(MAXTIME)
+
+if __name__ == '__main__':
+ bench()
diff --git a/src/pycryptopp/bench/bench_hashes.py b/src/pycryptopp/bench/bench_hashes.py
new file mode 100644
index 0000000..c681ff8
--- /dev/null
+++ b/src/pycryptopp/bench/bench_hashes.py
@@ -0,0 +1,52 @@
+from pycryptopp.hash import sha256
+
+from common import insecurerandstr, rep_bench
+
+UNITS_PER_SECOND = 10**9
+
+class SHA256(object):
+ def proc_init(self, N):
+ self.msg = insecurerandstr(N)
+
+ def proc(self, N):
+ h = sha256.SHA256()
+ h.update(self.msg)
+ h.digest()
+
+def generate_hash_benchers():
+ try:
+ import hashlib
+ except ImportError:
+ return [SHA256]
+ else:
+ class hashlibSHA256(object):
+ def proc_init(self, N):
+ self.msg = insecurerandstr(N)
+
+ def proc(self, N):
+ h = hashlib.sha256()
+ h.update(self.msg)
+ h.digest()
+
+ return [SHA256, hashlibSHA256]
+
+def bench_hashes(MAXTIME):
+ for klass in generate_hash_benchers():
+ print klass
+ ob = klass()
+ for (legend, size) in [
+ ("large (%d B)", 10**7),
+ ]:
+ print legend % size
+ rep_bench(ob.proc, size, UNITS_PER_SECOND=UNITS_PER_SECOND, MAXTIME=MAXTIME, MAXREPS=100, initfunc=ob.proc_init)
+ print
+
+ print "nanoseconds per byte hashed"
+ print
+
+
+def bench(MAXTIME=10.0):
+ bench_hashes(MAXTIME)
+
+if __name__ == '__main__':
+ bench()
diff --git a/src/pycryptopp/bench/bench_sigs.py b/src/pycryptopp/bench/bench_sigs.py
new file mode 100644
index 0000000..e0fe37b
--- /dev/null
+++ b/src/pycryptopp/bench/bench_sigs.py
@@ -0,0 +1,151 @@
+from pycryptopp.publickey import ecdsa, ed25519, rsa
+
+from common import insecurerandstr, rep_bench
+
+msg = 'crypto libraries should come with benchmarks'
+
+class ECDSA256(object):
+ def __init__(self):
+ self.seed = insecurerandstr(32)
+ self.signer = None
+
+ def gen(self, N):
+ for i in xrange(N):
+ ecdsa.SigningKey(self.seed)
+
+ def sign_init(self, N):
+ self.signer = ecdsa.SigningKey(self.seed)
+
+ def sign(self, N):
+ signer = self.signer
+ for i in xrange(N):
+ signer.sign(msg)
+
+ def ver_init(self, N):
+ signer = ecdsa.SigningKey(self.seed)
+ self.sig = signer.sign(msg)
+ self.verifier = signer.get_verifying_key()
+
+ def ver(self, N):
+ sig = self.sig
+ verifier = self.verifier
+ for i in xrange(N):
+ verifier.verify(sig, msg)
+
+class Ed25519(object):
+ def __init__(self):
+ self.seed = insecurerandstr(32)
+ self.signer = None
+
+ def gen(self, N):
+ for i in xrange(N):
+ ed25519.SigningKey(self.seed)
+
+ def sign_init(self, N):
+ self.signer = ed25519.SigningKey(self.seed)
+
+ def sign(self, N):
+ signer = self.signer
+ for i in xrange(N):
+ signer.sign(msg)
+
+ def ver_init(self, N):
+ signer = ed25519.SigningKey(self.seed)
+ self.sig = signer.sign(msg)
+ self.verifier = ed25519.VerifyingKey(signer.get_verifying_key_bytes())
+
+ def ver(self, N):
+ sig = self.sig
+ verifier = self.verifier
+ for i in xrange(N):
+ verifier.verify(sig, msg)
+
+class RSA2048(object):
+ SIZEINBITS=2048
+
+ def __init__(self):
+ self.signer = None
+
+ def gen(self, N):
+ for i in xrange(N):
+ rsa.generate(sizeinbits=self.SIZEINBITS)
+
+ def sign_init(self, N):
+ self.signer = rsa.generate(sizeinbits=self.SIZEINBITS)
+
+ def sign(self, N):
+ signer = self.signer
+ for i in xrange(N):
+ signer.sign(msg)
+
+ def ver_init(self, N):
+ signer = rsa.generate(sizeinbits=self.SIZEINBITS)
+ self.sig = signer.sign(msg)
+ self.verifier = signer.get_verifying_key()
+
+ def ver(self, N):
+ sig = self.sig
+ verifier = self.verifier
+ for i in xrange(N):
+ verifier.verify(msg, sig)
+
+class RSA3248(object):
+ SIZEINBITS=3248
+
+ def __init__(self):
+ self.signer = None
+
+ def gen(self, N):
+ for i in xrange(N):
+ rsa.generate(sizeinbits=self.SIZEINBITS)
+
+ def sign_init(self, N):
+ self.signer = rsa.generate(sizeinbits=self.SIZEINBITS)
+
+ def sign(self, N):
+ signer = self.signer
+ for i in xrange(N):
+ signer.sign(msg)
+
+ def ver_init(self, N):
+ signer = rsa.generate(sizeinbits=self.SIZEINBITS)
+ self.sig = signer.sign(msg)
+ self.verifier = signer.get_verifying_key()
+
+ def ver(self, N):
+ sig = self.sig
+ verifier = self.verifier
+ for i in xrange(N):
+ verifier.verify(msg, sig)
+
+def bench_sigs(MAXTIME):
+ for klass in [ECDSA256, Ed25519,]:
+ print klass
+ ob = klass()
+ print "generate key"
+ rep_bench(ob.gen, 1000, UNITS_PER_SECOND=1000, MAXTIME=MAXTIME, MAXREPS=100)
+ print "sign"
+ rep_bench(ob.sign, 1000, UNITS_PER_SECOND=1000, initfunc=ob.sign_init, MAXTIME=MAXTIME, MAXREPS=100)
+ print "verify"
+ rep_bench(ob.ver, 1000, UNITS_PER_SECOND=1000, initfunc=ob.ver_init, MAXTIME=MAXTIME, MAXREPS=100)
+ print
+
+ for klass in [RSA2048, RSA3248]:
+ print klass
+ ob = klass()
+ print "generate key"
+ rep_bench(ob.gen, 1, UNITS_PER_SECOND=1000, MAXTIME=MAXTIME, MAXREPS=100)
+ print "sign"
+ rep_bench(ob.sign, 1000, UNITS_PER_SECOND=1000, initfunc=ob.sign_init, MAXTIME=MAXTIME, MAXREPS=100)
+ print "verify"
+ rep_bench(ob.ver, 10000, UNITS_PER_SECOND=1000, initfunc=ob.ver_init, MAXTIME=MAXTIME, MAXREPS=100)
+ print
+
+ print "milliseconds per operation"
+ print
+
+def bench(MAXTIME=10.0):
+ bench_sigs(MAXTIME)
+
+if __name__ == '__main__':
+ bench()
diff --git a/src/pycryptopp/bench/common.py b/src/pycryptopp/bench/common.py
new file mode 100644
index 0000000..2d8f315
--- /dev/null
+++ b/src/pycryptopp/bench/common.py
@@ -0,0 +1,67 @@
+msg = "crypto libraries should come with benchmarks"
+
+try:
+ import pyutil.benchutil
+ rep_bench = pyutil.benchutil.rep_bench
+except (ImportError, AttributeError):
+ import platform, time
+ if 'windows' in platform.system().lower():
+ clock = time.clock
+ else:
+ clock = time.time
+
+ def this_rep_bench(func, N, UNITS_PER_SECOND, MAXTIME, MAXREPS, initfunc=None):
+ tt = time.time
+
+ if initfunc is not None:
+ initfunc(N)
+
+ meanc = 0
+ MAXREPS = 100
+
+ timeout = tt() + MAXTIME
+
+ for i in range(MAXREPS):
+ startc = clock()
+
+ func(N)
+
+ stopc = clock()
+
+ deltac = stopc - startc
+ if deltac <= 0:
+ print "clock jump backward or wrapped -- ignoring this sample. startc: %s, stopc: %s, deltac: %s" % (startc, stopc, deltac,)
+ else:
+ meanc += deltac
+
+ if time.time() >= timeout:
+ break
+
+ num = i+1
+ meanc *= UNITS_PER_SECOND
+ meanc /= num
+ meanc /= N
+
+ res = {
+ 'meanc': meanc,
+ 'num': num
+ }
+ print "mean: %(meanc)#8.03e (of %(num)6d)" % res
+ rep_bench = this_rep_bench
+
+import random as insecurerandom
+def insecurerandstr(n):
+ return ''.join(map(chr, map(insecurerandom.randrange, [0]*n, [256]*n)))
+
+def calib_clock():
+ interval = 1.0
+
+ import time
+ tc = time.clock
+ tt = time.time
+
+ def measure_sleep(x, clock):
+ st = clock()
+ time.sleep(x)
+
+
diff --git a/src/pycryptopp/cipher/aesmodule.cpp b/src/pycryptopp/cipher/aesmodule.cpp
index 0599911..360827d 100644
--- a/src/pycryptopp/cipher/aesmodule.cpp
+++ b/src/pycryptopp/cipher/aesmodule.cpp
@@ -50,7 +50,7 @@ this:\n\
Where 'masterkey' is a secret key used only for generating onetimekeys this\
way, and 'nonce' is a value that is guaranteed to never repeat.\
\n\
-@param key: the symmetric encryption key; a string of exactly 16 bytes\
+@param key: the symmetric encryption key; a string of exactly 16 or 32 bytes\
");
static PyObject *
diff --git a/src/pycryptopp/publickey/ecdsamodule.cpp b/src/pycryptopp/publickey/ecdsamodule.cpp
index 1ec7eec..ab18a50 100644
--- a/src/pycryptopp/publickey/ecdsamodule.cpp
+++ b/src/pycryptopp/publickey/ecdsamodule.cpp
@@ -18,7 +18,7 @@
* ECDSA(1363)/EMSA1(SHA-256) -- <a
* href="http://www.weidai.com/scan-mirror/sig.html#ECDSA">ECDSA</a>.
*
- * The keys (192-bit) use the curve ASN1::secp192r1() and SHA-256 as the
+ * The keys (256-bit) use the curve ASN1::secp256r1() and SHA-256 as the
* hash function. The Key Derivation Protocol is P1363_KDF2<SHA256>
* http://www.users.zetnet.co.uk/hopwood/crypto/scan/prf.html#KDF2
* to generate private (signing) keys from unguessable seeds -- see
@@ -41,7 +41,6 @@ typedef int Py_ssize_t;
#include <cryptopp/osrng.h>
#include <cryptopp/eccrypto.h>
#include <cryptopp/oids.h>
-#include <cryptopp/tiger.h>
#include <cryptopp/sha.h>
#include <cryptopp/pubkey.h>
// only needed for debugging -- the _dump() function
@@ -53,7 +52,6 @@ typedef int Py_ssize_t;
#include <src-cryptopp/osrng.h>
#include <src-cryptopp/eccrypto.h>
#include <src-cryptopp/oids.h>
-#include <src-cryptopp/tiger.h>
#include <src-cryptopp/sha.h>
#include <src-cryptopp/pubkey.h>
// only needed for debugging -- the _dump() function
@@ -62,13 +60,13 @@ typedef int Py_ssize_t;
#include <src-cryptopp/hex.h>
#endif
-static const int KEY_SIZE_BITS=192;
+static const int KEY_SIZE_BITS=256;
USING_NAMESPACE(CryptoPP)
-static const char*const ecdsa___doc__ = "ecdsa -- ECDSA(1363)/EMSA1(Tiger) signatures\n\
+static const char*const ecdsa___doc__ = "ecdsa -- ECDSA(1363)/EMSA1(SHA-256) signatures\n\
\n\
-To create a new ECDSA signing key (deterministically from a 12-byte seed), construct an instance of the class, passing the seed as argument, i.e. SigningKey(seed).\n\
+To create a new ECDSA signing key (deterministically from a 32-byte seed), construct an instance of the class, passing the seed as argument, i.e. SigningKey(seed).\n\
\n\
To get a verifying key from a signing key, call get_verifying_key() on the signing key instance.\n\
\n\
@@ -80,7 +78,7 @@ typedef struct {
PyObject_HEAD
/* internal */
- ECDSA<ECP, Tiger>::Verifier *k;
+ ECDSA<ECP, SHA256>::Verifier *k;
} VerifyingKey;
PyDoc_STRVAR(VerifyingKey__doc__,
@@ -96,8 +94,8 @@ VerifyingKey___init__(PyObject* self, PyObject* args, PyObject* kwdict) {
return NULL;
assert (serializedverifyingkeysize >= 0);
- if (serializedverifyingkeysize != 25) {
- PyErr_Format(ecdsa_error, "Precondition violation: size in bits is required to be %d (for %d-bit key), but it was %Zd", 25, KEY_SIZE_BITS, serializedverifyingkeysize);
+ if (serializedverifyingkeysize != 33) {
+ PyErr_Format(ecdsa_error, "Precondition violation: size in bits is required to be %d (for %d-bit key), but it was %d", 33, KEY_SIZE_BITS, serializedverifyingkeysize);
return -1;
}
@@ -106,11 +104,11 @@ VerifyingKey___init__(PyObject* self, PyObject* args, PyObject* kwdict) {
StringSource ss(reinterpret_cast<const byte*>(serializedverifyingkey), serializedverifyingkeysize, true);
ECP::Element element;
- DL_GroupParameters_EC<ECP> params(ASN1::secp192r1());
+ DL_GroupParameters_EC<ECP> params(ASN1::secp256r1());
params.SetPointCompression(true);
try {
element = params.DecodeElement(reinterpret_cast<const byte*>(serializedverifyingkey), true);
- mself->k = new ECDSA<ECP, Tiger>::Verifier(params, element);
+ mself->k = new ECDSA<ECP, SHA256>::Verifier(params, element);
if (!mself->k) {
PyErr_NoMemory();
return -1;
@@ -153,8 +151,8 @@ PyDoc_STRVAR(VerifyingKey_verify__doc__,
static PyObject *
VerifyingKey_serialize(VerifyingKey *self, PyObject *dummy) {
- ECDSA<ECP, Tiger>::Verifier *pubkey;
- pubkey = new ECDSA<ECP, Tiger>::Verifier(*(self->k));
+ ECDSA<ECP, SHA256>::Verifier *pubkey;
+ pubkey = new ECDSA<ECP, SHA256>::Verifier(*(self->k));
const DL_GroupParameters_EC<ECP>& params = pubkey->GetKey().GetGroupParameters();
Py_ssize_t len = params.GetEncodedElementSize(true);
@@ -222,7 +220,7 @@ typedef struct {
PyObject_HEAD
/* internal */
- ECDSA<ECP, Tiger>::Signer *k;
+ ECDSA<ECP, SHA256>::Signer *k;
} SigningKey;
static void
@@ -232,7 +230,7 @@ SigningKey_dealloc(SigningKey* self) {
self->ob_type->tp_free((PyObject*)self);
}
-static const char* TAG_AND_SALT = "102:pycryptopp v0.5.3 key derivation algorithm using Tiger hash to generate ECDSA 192-bit secret exponents," \
+static const char* TAG_AND_SALT = "102:pycryptopp v0.5.3 key derivation algorithm using SHA-256 hash to generate ECDSA 256-bit secret exponents," \
"16:H1yGNvUONoc0FD1d,";
static const size_t TAG_AND_SALT_len = 127;
@@ -275,39 +273,39 @@ SigningKey___init__(PyObject* self, PyObject* args, PyObject* kwdict) {
return -1;
}
- if (seedlen != 12) {
- PyErr_Format(ecdsa_error, "Precondition violation: seed is required to be of length 12, but it was %zd", seedlen);
+ if (seedlen != 32) {
+ PyErr_Format(ecdsa_error, "Precondition violation: seed is required to be of length 32, but it was %zd", seedlen);
return -1;
}
OID curve;
Integer grouporderm1;
- byte privexpbytes[24] = {0};
+ byte privexpbytes[32] = {0};
Integer privexponentm1;
privexponentm1.Decode(privexpbytes, sizeof(privexpbytes)); assert (privexponentm1 == 0); // just checking..
- DL_GroupParameters_EC<ECP> params(ASN1::secp192r1());
+ DL_GroupParameters_EC<ECP> params(ASN1::secp256r1());
params.SetPointCompression(true);
grouporderm1 = params.GetGroupOrder() - 1;
- Tiger t;
+ SHA256 t;
t.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
t.Update(reinterpret_cast<const byte*>(seed), seedlen);
- t.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
+ t.TruncatedFinal(privexpbytes, SHA256::DIGESTSIZE);
privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
while (privexponentm1 >= grouporderm1) {
- Tiger t2;
+ SHA256 t2;
t2.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
std::cerr << "WHEE " << sizeof(privexpbytes) << "\n";std::cerr.flush();
t2.Update(privexpbytes, sizeof(privexpbytes));
- t2.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
+ t2.TruncatedFinal(privexpbytes, SHA256::DIGESTSIZE);
privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
}
SigningKey* mself = reinterpret_cast<SigningKey*>(self);
- mself->k = new ECDSA<ECP, Tiger>::Signer(params, privexponentm1+1);
+ mself->k = new ECDSA<ECP, SHA256>::Signer(params, privexponentm1+1);
if (!mself->k) {
PyErr_NoMemory();
@@ -318,9 +316,9 @@ SigningKey___init__(PyObject* self, PyObject* args, PyObject* kwdict) {
}
PyDoc_STRVAR(SigningKey__init____doc__,
-"Create a signing key (192 bits) deterministically from the given seed.\n\
+"Create a signing key (256 bits) deterministically from the given seed.\n\
\n\
-This implies that if someone can guess the seed then they can learn the signing key. A good way to get an unguessable seed is os.urandom(12).\n\
+This implies that if someone can guess the seed then they can learn the signing key. A good way to get an unguessable seed is os.urandom(32).\n\
\n\
@param seed seed\n\
\n\
@@ -444,7 +442,7 @@ SigningKey_get_verifying_key(SigningKey *self, PyObject *dummy) {
if (!verifier)
return NULL;
- verifier->k = new ECDSA<ECP, Tiger>::Verifier(*(self->k));
+ verifier->k = new ECDSA<ECP, SHA256>::Verifier(*(self->k));
if (!verifier->k)
return PyErr_NoMemory();
verifier->k->AccessKey().AccessGroupParameters().SetPointCompression(true);
diff --git a/src/pycryptopp/publickey/ed25519/__init__.py b/src/pycryptopp/publickey/ed25519/__init__.py
index f399769..4dd94ad 100644
--- a/src/pycryptopp/publickey/ed25519/__init__.py
+++ b/src/pycryptopp/publickey/ed25519/__init__.py
@@ -1,6 +1,6 @@
-from keys import (BadSignatureError, SigningKey, VerifyingKey)
+from keys import (BadSignatureError, SigningKey, VerifyingKey, __doc__)
-(BadSignatureError, SigningKey, VerifyingKey) # hush pyflakes
+(BadSignatureError, SigningKey, VerifyingKey, __doc__) # hush pyflakes
from _version import get_versions
__version__ = get_versions()['version']
diff --git a/src/pycryptopp/publickey/ed25519/keys.py b/src/pycryptopp/publickey/ed25519/keys.py
index 5d7eafb..ebd82ff 100644
--- a/src/pycryptopp/publickey/ed25519/keys.py
+++ b/src/pycryptopp/publickey/ed25519/keys.py
@@ -1,6 +1,23 @@
import _ed25519
BadSignatureError = _ed25519.BadSignatureError
+__doc__ = """\
+ed25519 -- Ed25519 public-key signatures
+
+To create a new Ed25519 signing key, create a 32-byte unguessable bytestring,
+with keybytes=os.urandom(32), and pass it to the SigningKey(keybytes)
+constructor. To create the same key in the future, call the constructor with
+the same string.
+
+To get a verifying key from a signing key, first get the verifying key bytes
+with verfbytes=sk.get_verifying_key_bytes(), then construct the VerifyingKey
+instance with VerifyingKey(verfbytes).
+
+To sign a message, use sig=sk.sign(msg), which returns the signature as a
+64-byte binary bytestring. To verify a signature, use vk.verify(sig, msg),
+which either returns None or raises BadSignatureError.
+"""
+
class SigningKey(object):
# this is how all keys are created
def __init__(self, sk_bytes):
diff --git a/src/pycryptopp/test/test_aes.py b/src/pycryptopp/test/test_aes.py
index 16c3e20..591b171 100644
--- a/src/pycryptopp/test/test_aes.py
+++ b/src/pycryptopp/test/test_aes.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import random, re
import unittest
diff --git a/src/pycryptopp/test/test_ecdsa.py b/src/pycryptopp/test/test_ecdsa.py
index d70a000..85f809d 100644
--- a/src/pycryptopp/test/test_ecdsa.py
+++ b/src/pycryptopp/test/test_ecdsa.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import random
import base64
@@ -53,11 +51,9 @@ def div_ceil(n, d):
"""
return (n/d) + (n%d != 0)
-KEYBITS=192
+KEYBITS =256
-# The number of bytes required for a seed to have the same security level as a
-# key in this elliptic curve: 2 bits of public key per bit of security.
-SEEDBITS=div_ceil(192, 2)
+SEEDBITS=256
SEEDBYTES=div_ceil(SEEDBITS, 8)
# The number of bytes required to encode a public key in this elliptic curve.
@@ -246,16 +242,15 @@ class Compatibility(unittest.TestCase):
def test_compatibility(self):
# Confirm that the KDF used by the SigningKey constructor doesn't
# change without suitable backwards-compability
- seed = base64.b32decode('XS27TJRP3JBZKDEFBDKQ====')
+ seed = 'bd616451f65d151ddd63efef42202c13457d1a0a44fb6f642be4bf9567ef19c6'.decode('hex')
signer = ecdsa.SigningKey(seed)
v1 = signer.get_verifying_key()
vs = v1.serialize()
vs32 = base64.b32encode(vs)
- self.failUnlessEqual(vs32, "ANPNDWJWHQXYSQMD4L36D7WQEGXA42MS5JRUFIWA")
+ self.failUnlessEqual(vs32, "AIWKEM44YHQCR3VI7SF7IJI7SSW6YNLMGMWBIXQWXC5522H2KXXHO===")
v2 = ecdsa.VerifyingKey(vs)
- #print base64.b32encode(signer.sign("message"))
- sig32 = "EA3Y7A4T62J3K6MUPJQN3WJ5S4SS53EGZXOSTQW7EQ7OXEMS6QJLYL63BLHMHZD7KFT37KEPJBAKI==="
- sig = base64.b32decode(sig32)
+ # print signer.sign("message").encode('hex')
+ sig = 'a914953c6e6cecaf97d3d7f142ed1da88014752c3e1cd43b38f3327a73be67075bda7ec4a2ead5bb8a3471271a44ffbbd456b4d3ca470584c05703fdbe7b5bc0'.decode('hex')
self.failUnless(v1.verify("message", sig))
self.failUnless(v2.verify("message", sig))
diff --git a/src/pycryptopp/test/test_from_Nikratio.py b/src/pycryptopp/test/test_from_Nikratio.py
index a991415..d680daf 100644
--- a/src/pycryptopp/test/test_from_Nikratio.py
+++ b/src/pycryptopp/test/test_from_Nikratio.py
@@ -2,7 +2,7 @@ import unittest
# This was reported as triggering a "Use of uninitialised value of
# size 4" under valgrind by Nikratio in pycryptopp-0.5.17 and Crypto++
-# 5.6.0. See http://tahoe-lafs.org/trac/pycryptopp/ticket/67
+# 5.6.0. See https://tahoe-lafs.org/trac/pycryptopp/ticket/67
class T(unittest.TestCase):
def test_t(self):
diff --git a/src/pycryptopp/test/test_rsa.py b/src/pycryptopp/test/test_rsa.py
index 15294bc..7311a4f 100644
--- a/src/pycryptopp/test/test_rsa.py
+++ b/src/pycryptopp/test/test_rsa.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import random
import unittest
diff --git a/src/pycryptopp/test/test_sha256.py b/src/pycryptopp/test/test_sha256.py
index 5e982dc..5705b91 100644
--- a/src/pycryptopp/test/test_sha256.py
+++ b/src/pycryptopp/test/test_sha256.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import random, re
import unittest
diff --git a/src/pycryptopp/test/test_xsalsa20.py b/src/pycryptopp/test/test_xsalsa20.py
index f3ee02a..0f949e7 100644
--- a/src/pycryptopp/test/test_xsalsa20.py
+++ b/src/pycryptopp/test/test_xsalsa20.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import random, re
import unittest