aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
Commit message (Collapse)AuthorAgeFilesLines
* add support for update_into on CipherContext (#3190)Paul Kehrer2017-02-161-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add support for update_into on CipherContext This allows you to provide your own buffer (like recv_into) to improve performance when repeatedly calling encrypt/decrypt on large payloads. * another skip_if * more skip_if complexity * maybe do this right * correct number of args * coverage for the coverage gods * add a cffi minimum test tox target and travis builder This tests against macOS so we capture some commoncrypto branches * extra arg * need to actually install py35 * fix * coverage for GCM decrypt in CC * no longer relevant * 1.8 now * pep8 * dramatically simplify * update docs * remove unneeded test * changelog entry * test improvements * coverage fix * add some comments to example * move the comments to their own line * fix and move comment
* DH serialization (#3297)Aviv Palivoda2017-02-071-0/+46
| | | | | | | | | | | | | | | | | | * DH keys support serialization * Add DH serialization documentation * Add tests for DH keys serialization in DER encoding * update version to 1.8 * Allow only SubjectPublicKeyInfo serialization * Remove support in TraditionalOpenSSL format * Fix pep8 * Refactor dh serialization tests
* Scrypt docs code example contradict RFC 7914 (#3302) (#3303)Nick Badger2016-12-101-12/+14
| | | | | | | | | | | | * Scrypt docs code example contradict RFC 7914 (#3302) * More secure example difficulty of parameter n in scrypt docs (#3302) * Change link text to scrypt paper (#3302) * Change link text to scrypt paper, part deux (#3302) * Add "logins" to spelling wordlist
* OpenSSL DH backend implementation [Second attempt] (#2914)Aviv Palivoda2016-11-261-43/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start of OpenSSL DH backend implementation * Supporting DH in MultiBackend * DHBackend has dh_parameters_supported method * Removed DHParametersWithNumbers and DHPrivateKeyWithNumbers from documentation * Removed ExchangeContext. exchange is a method of DHPrivateKeyWithSerialization * PEP8 fixes * Fixed TestDH.test_bad_tls_exchange * Fixed generate_private_key reference in dh documentation * test DH multibackend support * testing DH coversion to serialized * Validating that we receive serialized class in test_generate_dh * Testing DH exchange symmetric key padding * struct DH is now opaqued * PEP8 fixes * Testing load_dh_private_numbers throws ValueError when DH_check fails * Using openssl_assert * Passing keywords arguments in DH key exchange example * test_dh::test_bad_tls_exchange now uses pre calculated parameters * TestDH - Add test that the computed secret is equivalent to the definition by comparing with secret computed in pure python * Add missing generator parameter to DHBackend interface docs. * Include parameter type in DHBackend abc docs. * Add docs for dh.generate_parameters function * Remove the dh Numbers section, and move the DHNumbers class docs to where they are first used. * Add note of big endian byte packing to DH exchange method. * DH documentation updates. Add single sentence overview with wikipedia link. Add paragraph on assembling using Numbers objects. Add link to backend interface docs. First section was all indented, I think by mistake. * Add exchange method to DHPrivateKey abstract base class. * Small tweaks to DH documentation - remove Provider. * Add endian to dictionary * Use utils.int_from_bytes in test_tls_exchange_algorithm * Removed duplicate line * Change dh.rst exchange algorithm from doctest to code-block The example in the Diffie-Hellman exhange algorithm is using 2048 bits key. Generating the parameters of 2048 takes long time. This caused the automated tests to fail. In order to pass the tests we change the example to code-block so it will not run in the doc tests. * Fix dh docs * Document the generator in DHBackend relevant methods * Fix dh tests * use DHparams_dup * Fix key type to unsigned char as expected by DH_compute_key * Validate that DH generator is 2 or 5 * test dh exchange using botan vectors * group all numbers classes * Simplify _DHPrivateKey * Rename test with serialized to numbers * Move bad exchange params to external vector file * update exchange versionadded to 1.7 * Make key_size bit accurate * Change botan link * Added CHANGELOG entry
* update docs and changelog for prehashed support (#3268)Paul Kehrer2016-11-201-3/+15
|
* add support for prehashing in ECDSA sign/verify (#3267)Paul Kehrer2016-11-201-1/+5
| | | | | | * add support for prehashing in ECDSA sign/verify * move signature_algorithm check to its own function
* support prehashed sign/verify in DSA (#3266)Paul Kehrer2016-11-201-2/+12
|
* support RSA verify with prehashing (#3265)Paul Kehrer2016-11-202-2/+19
| | | | | | | | | | * support RSA verify with prehashing * review feedback * more dedupe * refactor and move to a separate module
* support prehashing in RSA sign (#3238)Paul Kehrer2016-11-202-1/+40
| | | | | | | | * support prehashing in RSA sign * check to make sure digest size matches prehashed data provided * move doctest for prehashed
* change derive_elliptic_curve_public_point to return EllipticCurvePubl… (#3243)Paul Kehrer2016-11-181-3/+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/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Last pass over fixing the links (#3224)Alex Gaynor2016-11-061-1/+1
|
* Link to our implementation of scrypt, now that we have it (#3189)Alex Gaynor2016-10-071-2/+2
|
* EC samples for verifying a singature, + serialization (#3076)Alex Railean2016-09-251-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | * first draft of verification and serialization * tweaks in the RST syntax * added example of deserialization * taking into account the returned value, so that doctests pass * adjusted rst syntax and indentation for code samples * removed print call * forgot to actually call splitlines * added missing argument when loading private key * added Deserialization to dictionary * made lines shorter to meet style requirements * applied requested changes in style
* Fix typo in `symmetric-encryption.rst` (#3138)Alex Chan2016-09-041-1/+1
|
* Add bounds checking for Scrypt parameters. (#3130)Terry Chia2016-09-021-0/+3
| | | | | | | | | | * Add bounds checking for Scrypt parameters. * Pep8. * More PEP8. * Change wording.
* Scrypt Implementation (#3117)Terry Chia2016-09-011-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* some docs cleanups + changelog (#3122)Alex Gaynor2016-08-301-3/+2
|
* Mention that blake2 is not vulnerable to length-extension attacks (#3118)Alex Gaynor2016-08-291-1/+4
| | | | | | | | * Mention that blake2 is not vulnerable to length-extension attacks * SHA is sort of like a word, in the sense that I want the spellcheck to shut up about it * rephrase
* blake2b/blake2s support (#3116)Paul Kehrer2016-08-281-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix docs to clarify the less than 256 limit for Padding(). (#3099)Terry Chia2016-08-241-2/+2
| | | | | | * Fix docs to clarify the less than 256 limit. * Add "inclusive".
* Update example code to use recommended 160 bits (#3088)Dave Brondsema2016-08-161-2/+2
| | | I found the examples with `os.urandom(16)` generated URIs that Google Authenticator and Duo two-factor apps did not even recognize as supported. This increases the key to the recommended 160 bits, and the URIs now work with both of those apps.
* Remove provider language from docs (#3072)Gabriel Orisaka2016-07-318-68/+54
|
* Clarify what to pass to the sign-function (#3066)Loy2016-07-301-1/+1
| | | Sign needs an ECDSA instance and from following the link to EllipticCurveSignatureAlgorithm, that wasn't clear directly.
* Removed provider language from asymmetric primitives docs (#3052)Gabriel Orisaka2016-07-265-132/+91
| | | | | | * Removed provider language from asymmetric primitives docs * Reverted changes to some examples
* Enforce that p > q to improve OpenSSL compatibility (fixes #2990) (#3010)Dirkjan Ochtman2016-07-191-1/+3
|
* A few small cleanups (#3046)Alex Gaynor2016-07-181-2/+2
|
* Add flag to toggle key length check for HOTP and TOTP. (#3012)Terry Chia2016-07-161-2/+22
| | | | | | | | | | * 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-022-5/+46
| | | | | | | | | | | | | | * 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 verify documentation fix (#3031)Aviv Palivoda2016-06-302-4/+4
|
* One shot sign/verify DSA (#3003)Aviv Palivoda2016-06-301-0/+53
| | | | | | | | * 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-4/+17
| | | | | | | | | | | | | | * 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
* rest syntaxAlex Gaynor2016-06-271-1/+1
|
* Fixes #2992 -- clearly link to a key dumping docs in serialization mo… (#3013)Alex Gaynor2016-06-251-0/+10
| | | | | | | | * Fixes #2992 -- clearly link to a key dumping docs in serialization module * fixed rest * guh, grammar
* Use `d` instead of `private_exponent` for consistency (#2991)Dirkjan Ochtman2016-06-221-4/+4
| | | | 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.
* Clean up some of the nonsense in our DSA docs. (#2969)Alex Gaynor2016-06-041-5/+5
| | | Fixes #1478
* Add convenience methods to sign and verify w/ RSA (#2945)Colleen Murphy2016-06-041-3/+73
| | | | | | | | | 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
* Refs #1478 -- attempt to improve our nonsense docs for ECCurve.key_size (#2959)Alex Gaynor2016-06-031-1/+2
| | | | | | * Refs #1478 -- attempt to improve our nonsense docs for ECCurve.key_size * fix
* SSH serialization for public keys (#2957)Alex Gaynor2016-06-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* NIST SP 800-108 Counter Mode KDF (#2748)Jared2016-05-291-0/+150
| | | | | | | | | | | | | | | | | | * 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 #2859 -- document that SHA-1 is the worst (#2925)Alex Gaynor2016-05-291-1/+3
| | | | | | * Fixed #2859 -- document that SHA-1 is the worst * words words words
* Merge pull request #2736 from cedk/ANSI_X.923Paul Kehrer2016-03-161-0/+45
|\ | | | | Added support for padding ANSI X.923
| * Add version in the docCédric Krier2016-03-151-0/+2
| |
| * Add wikipedia link to ANSI X.923Cédric Krier2016-02-271-4/+6
| |
| * Added support for padding ANSI X.923Cédric Krier2016-02-271-0/+41
| |
* | HTTPS some links, in the odd event users of a cryptographic library would ↵Alex Gaynor2016-03-063-3/+3
|/ | | | care about authentication, integrity, or confidentiality
* Clearly document that this is a good exampleAlex Gaynor2016-02-101-0/+3
|
* As always, recommend cryptoing while you cryptoAlex Gaynor2016-02-021-1/+1
|
* Minor doc tweak per issue #2694Phoebe Queen2016-01-291-1/+5
|