Name Description Size
__init__.py 1931
_compat.py Common functions for providing cross-python version compatibility. 4047
_rwlock.py Read-Write locking primitive Synchronization object used in a solution of so-called second readers-writers problem. In this problem, many readers can simultaneously access a share, and a writer has an exclusive access to this share. Additionally, the following constraints should be met: 1) no reader should be kept waiting if the share is currently opened for reading unless a writer is also waiting for the share, 2) no writer should be kept waiting for the share longer than absolutely necessary. The implementation is based on [1, secs. 4.2.2, 4.2.6, 4.2.7] with a modification -- adding an additional lock (C{self.__readers_queue}) -- in accordance with [2]. Sources: [1] A.B. Downey: "The little book of semaphores", Version 2.1.5, 2008 [2] P.J. Courtois, F. Heymans, D.L. Parnas: "Concurrent Control with 'Readers' and 'Writers'", Communications of the ACM, 1971 (via [3]) [3] http://en.wikipedia.org/wiki/Readers-writers_problem 2849
_sha3.py Implementation of the SHAKE-256 algorithm for Ed448 4747
_version.py { "date": "2025-03-13T12:48:15+0100", "dirty": false, "error": null, "full-revisionid": "2a6593d840ad153a16ebdd4f9b772b290494f3e3", "version": "0.19.1" } 498
curves.py Serialise the curve parameters to binary string. :param str encoding: the format to save the curve parameters in. Default is ``named_curve``, with fallback being the ``explicit`` if the OID is not set for the curve. :param str point_encoding: the point encoding of the generator when explicit curve encoding is used. Ignored for ``named_curve`` format. :return: DER encoded ECParameters structure :rtype: bytes 15975
der.py Encode and IMPLICIT value using :term:`DER`. :param int tag: the tag value to encode, must be between 0 an 31 inclusive :param bytes value: the data to encode :param str cls: the class of the tag to encode: "application", "context-specific", or "private" :rtype: bytes 16444
ecdh.py Class for performing Elliptic-curve Diffie-Hellman (ECDH) operations. 11011
ecdsa.py Low level implementation of Elliptic-Curve Digital Signatures. .. note :: You're most likely looking for the :py:class:`~ecdsa.keys` module. This is a low-level implementation of the ECDSA that operates on integers, not byte strings. NOTE: This a low level implementation of ECDSA, for normal applications you should be looking at the keys.py module. Classes and methods for elliptic-curve signatures: private keys, public keys, signatures, and definitions of prime-modulus curves. Example: .. code-block:: python # (In real-life applications, you would probably want to # protect against defects in SystemRandom.) from random import SystemRandom randrange = SystemRandom().randrange # Generate a public/private key pair using the NIST Curve P-192: g = generator_192 n = g.order() secret = randrange( 1, n ) pubkey = Public_key( g, g * secret ) privkey = Private_key( pubkey, secret ) # Signing a hash value: hash = randrange( 1, n ) signature = privkey.sign( hash, randrange( 1, n ) ) # Verifying a signature for a hash value: if pubkey.verifies( hash, signature ): print("Demo verification succeeded.") else: print("*** Demo verification failed.") # Verification fails if the hash value is modified: if pubkey.verifies( hash-1, signature ): print("**** Demo verification failed to reject tampered hash.") else: print("Demo verification correctly rejected tampered hash.") Revision history: 2005.12.31 - Initial version. 2008.11.25 - Substantial revisions introducing new classes. 2009.05.16 - Warn against using random.randrange in real applications. 2009.05.17 - Use random.SystemRandom by default. Originally written in 2005 by Peter Pearson and placed in the public domain, modified as part of the python-ecdsa package. 31699
eddsa.py Implementation of Edwards Digital Signature Algorithm. 7170
ellipticcurve.py :term:`Short Weierstrass Elliptic Curve <short Weierstrass curve>` over a prime field. 54296
errors.py Raised in case the encoding of private or public key is malformed. 130
keys.py Primary classes for performing signing and verification operations. 65503
numbertheory.py Base class for exceptions in this module. 17831
rfc6979.py RFC 6979: Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA) http://tools.ietf.org/html/rfc6979 Many thanks to Coda Hale for his implementation in Go language: https://github.com/codahale/rfc6979 2850
ssh.py 1916
test_curves.py 13081
test_der.py This is the old way to use the function. 18915
test_ecdh.py 15380
test_ecdsa.py Check test vectors from X9.62 25037
test_eddsa.py 33720
test_ellipticcurve.py 8798
test_jacobi.py 25811
test_keys.py Verify that ecdsa.keys.VerifyingKey.from_string() can be used with bytes-like objects 39415
test_malformed_sigs.py Since the data is hashed for processing, really any string will do. 11289
test_numbertheory.py Strategy that returns lists of numbers, all having a common factor. 13265
test_pyecdsa.py 91272
test_rw_lock.py @param buffer_: common buffer_ shared by the readers and writers @type buffer_: list @type rw_lock: L{RWLock} @param init_sleep_time: sleep time before doing any action @type init_sleep_time: C{float} @param sleep_time: sleep time while in critical section @type sleep_time: C{float} @param to_write: data that will be appended to the buffer 7021
test_sha3.py 3042
util.py This module includes some utility functions. The methods most typically used are the sigencode and sigdecode functions to be used with :func:`~ecdsa.keys.SigningKey.sign` and :func:`~ecdsa.keys.VerifyingKey.verify` respectively. See the :func:`sigencode_strings`, :func:`sigdecode_string`, :func:`sigencode_der`, :func:`sigencode_strings_canonize`, :func:`sigencode_string_canonize`, :func:`sigencode_der_canonize`, :func:`sigdecode_strings`, :func:`sigdecode_string`, and :func:`sigdecode_der` functions. 18006