aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/primitives
Commit message (Collapse)AuthorAgeFilesLines
...
* change derive_elliptic_curve_public_point to return EllipticCurvePubl… (#3243)Paul Kehrer2016-11-181-7/+4
| | | | | | | | | | | | | | * change derive_elliptic_curve_public_point to return EllipticCurvePublicKey * also rename the backend interface method * review feedback * Rename to derive_elliptic_curve_private_key * Returns EllipticCurvePrivateKey * Reuses the EC_POINT in the openssl impl * Rename "secret" arg to "private_value" which is consistent with our naming for the value in ECPrivateNumbers.
* Raise padding block_size limit to what is allowed by the specs. (#3108)Terry Chia2016-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | * Raize padding block_size limit to what is allowed by the specs. * Add tests for raising padding limits. * Amend C code for padding check to use uint16_t instead of uint8_t. * Fix test to work in Python 3. * Fix typo. * Fix another typo. * Fix return type of the padding checks. * Change hypothesis test on padding. * Update comment.
* add ec.private_key_from_secret_and_curve (#3225)Ofek Lev2016-11-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * finish https://github.com/pyca/cryptography/pull/1973 * change API & add test Function will now return an instance of EllipticCurvePrivateKey, as that is the users' ultimate goal anyway. * fix test * improve coverage * complete coverage * final fix * centos fix * retry * cleanup asserts * use openssl_assert * skip unsupported platforms * change API name to derive_private_key * change version added * improve description of `secret` param * separate successful and failure test cases * simplify successful case * add docs for derive_elliptic_curve_public_point * add period
* Fixes #3211 -- fixed hkdf's output with short length (#3215)Alex Gaynor2016-11-061-1/+1
|
* Add bounds checking for Scrypt parameters. (#3130)Terry Chia2016-09-021-0/+10
| | | | | | | | | | * Add bounds checking for Scrypt parameters. * Pep8. * More PEP8. * Change wording.
* Scrypt Implementation (#3117)Terry Chia2016-09-011-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | * Scrypt implementation. * Docs stuff. * Make example just an example and not a doctest. * Add changelog entry. * Docs cleanup. * Add more tests. * Add multibackend tests. * PEP8. * Add docs about Scrypt parameters. * Docs cleanup. * Add AlreadyFinalized.
* blake2b/blake2s support (#3116)Paul Kehrer2016-08-281-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | * blake2b/blake2s support Doesn't support keying, personalization, salting, or tree hashes so the API is pretty simple right now. * implement digest_size via utils.read_only_property * un-keyed for spelling's sake * test copying + digest_size checks * unkeyed is too a word * line wrap * reword the docs * use the evp algorithm name in the error This will make BLAKE2 alternate digest size errors a bit less confusing * add changelog entry and docs about supported digest_size
* Enforce that p > q to improve OpenSSL compatibility (fixes #2990) (#3010)Dirkjan Ochtman2016-07-191-1/+1
|
* Add flag to toggle key length check for HOTP and TOTP. (#3012)Terry Chia2016-07-162-4/+6
| | | | | | | | | | * Add an enforce_key_length parameter to HOTP and TOTP. * Document changes in docs. * Add some words to the wordlist. * Add versionadded to docs.
* One shot sign/verification ECDSA (#3029)Aviv Palivoda2016-07-021-0/+12
| | | | | | | | | | | | | | * Add sign and verify methods to ECDSA * Documented ECDSA sign/verify methods * Added CHANGELOG entry * Skipping test verify and sign if curve is not supported * Fixed typo in documentation return type * Removed provider language from EllipticCurvePrivateKey and EllipticCurvePublicKey
* One shot sign/verify DSA (#3003)Aviv Palivoda2016-06-301-0/+12
| | | | | | | | * Add sign and verify methods to DSA * Documented DSA sign/verify methods * Added CHANGELOG entry
* Fixed #3008 -- expose calculate max pss salt length (#3014)Alex Gaynor2016-06-271-0/+12
| | | | | | | | | | | | | | * Fixed #3008 -- expose calculate max pss salt length * Fixed a few mistakes in the docs * move all the code around * oops * write a unit test * versionadded + changelog
* Use `d` instead of `private_exponent` for consistency (#2991)Dirkjan Ochtman2016-06-221-2/+2
| | | | True story: I used `e` instead of `d` because it seemed more closely related to `e`. Should have looked it up, of course... but the docs could be better.
* Add convenience methods to sign and verify w/ RSA (#2945)Colleen Murphy2016-06-041-0/+12
| | | | | | | | | This patch adds wrapper methods to allow the user to sign and verify a single message block without having to go through the multi-step process of creating a signer or verifier, updating it with the one message, and finalizing the result. This will make signing and verifying data more user-friendly when only using small messages. Partial bug #1529
* added a repr to the dsa numbers classes (#2961)Alex Gaynor2016-06-031-0/+13
| | | | | | | | * added a repr to the dsa numbers classes * fix * another test
* SSH serialization for public keys (#2957)Alex Gaynor2016-06-031-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * SSH serialization for public keys * name errors ahoy! * id, ego, superego * dsa support * EC support * Don't keyerror * Documentation OpenSSH * flake8 * fix * bytes bytes bytes * skip curve unsupported * bytes! * Move a function * reorganize code for coverage
* Fixing typo in asymmetric utils (#2947)Chelsea Winfree2016-06-021-4/+2
| | | | | | * Fixing typo in asymmetric utils * Fixed the other similar typo on utils
* KBKDF cleanup (#2929)Paul Kehrer2016-05-291-1/+1
| | | | | | | | * unicode characters make everything angry * changelog entry and make skip msgs more informative * typo fix
* NIST SP 800-108 Counter Mode KDF (#2748)Jared2016-05-291-0/+148
| | | | | | | | | | | | | | | | | | * NIST SP 800-108 Counter Mode and Feedback Mode KDF * CounterKDF unit tests * Refactor to support multiple key based KDF modes. * Extracting supported algorithms for KBKDF Counter Mode test vectors * Adding support for different rlen and counter location in KBKDF * support for multiple L lengths and 24 bit counter length. * Adding KBKDF Documentation. * Refactoring KBKDF to KBKDFHMAC to describe hash algorithm used.
* Fixed #2887 -- implement __hash__ on EC numbers classes (#2888)Alex Gaynor2016-04-301-0/+6
|
* Handle two more error conditions correctlyAlex Gaynor2016-04-021-0/+6
| | | | | | * Handle two more error conditions correctly * fixed test case
* Merge pull request #2736 from cedk/ANSI_X.923Paul Kehrer2016-03-161-47/+125
|\ | | | | Added support for padding ANSI X.923
| * Don't use subclassCédric Krier2016-03-141-88/+112
| |
| * Make _padding and _check_padding abstractmethodCédric Krier2016-02-271-2/+10
| |
| * Add padding check for ANSI X.923Cédric Krier2016-02-271-1/+3
| | | | | | | | All padding bytes must be 0.
| * Factorize out common byte paddingCédric Krier2016-02-271-18/+33
| |
| * Added support for padding ANSI X.923Cédric Krier2016-02-271-4/+33
| |
* | improved languagePaul Kehrer2016-03-071-1/+1
| |
* | require mode nonce/iv/tag data to be bytesPaul Kehrer2016-03-071-0/+21
| |
* | We wrote a function, now use itAlex Gaynor2016-03-061-12/+2
| |
* | Correct the error string for a messageAlex Gaynor2016-02-281-1/+1
|/
* Add support for 160 bit ARC4 keysEhren Kret2015-11-281-1/+1
|
* add ellipticcurvepublicnumbers reprPaul Kehrer2015-10-281-0/+6
|
* address review feedbackPaul Kehrer2015-10-281-5/+2
|
* modify approach to use EllipticCurvePublicNumbers methodsPaul Kehrer2015-10-272-34/+28
|
* remove support for null points, improve docsPaul Kehrer2015-10-271-4/+4
|
* add support for encoding/decoding elliptic curve pointsPaul Kehrer2015-10-261-0/+34
| | | | Based on the work of @ronf in #2346.
* update a commentPaul Kehrer2015-10-221-2/+3
|
* AES keywrap supportPaul Kehrer2015-10-211-0/+84
|
* better document hte ifaceAlex Gaynor2015-10-171-0/+7
|
* unused importAlex Gaynor2015-10-171-1/+0
|
* a refactor to the APIAlex Gaynor2015-10-171-21/+1
|
* Add an Elliptic Curve Key Exchange Algorithm(ECDH)Simo Sorce2015-10-171-0/+25
| | | | | | | | | The ECDH Key Exchange algorithm as standardized in NIST publication 800-56A Revision 2 Includes tests with vectors from NIST. Signed-off-by: Simo Sorce <simo@redhat.com>
* Kill Key Exchange as a separate interfaceSimo Sorce2015-10-151-18/+0
| | | | | | | | Ultimately it was decided that ECDH and the others can be implemented as simple classes without the overhead of an interface. So ... let's kill it, it was a fun process. Signed-off-by: Simo Sorce <simo@redhat.com>
* Introduce Key Exchange Agreements interfaceSimo Sorce2015-10-071-0/+18
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add X963KDF from ANSI X9.63:2001Simo Sorce2015-09-241-0/+70
| | | | | | | | | | The implemention allows the use a Hash function to implement a KDF very similar to ConcatKDFHash, just different enough to require a separate derivation function. Closes #2203 Signed-off-by: Simo Sorce <simo@redhat.com>
* resolve incorrect docs/naming around DSA (r, s) tuple encode/decodePaul Kehrer2015-08-101-0/+26
|
* Fixes #2199 -- allow SSH keys to have spaces in their commentsAlex Gaynor2015-08-031-2/+2
|
* Fixed #2143 -- added __hash__ to RSA{Public,Private}NumbersAlex Gaynor2015-07-121-0/+14
|
* move PublicKeyWithSerialization methods to PublicKeyPaul Kehrer2015-07-043-9/+9
|