aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_ec.py
Commit message (Collapse)AuthorAgeFilesLines
* Deal with the 2.5 deprecations (#5048)Alex Gaynor2019-11-031-1/+1
| | | | | | | | | | | | * Deal with the 2.5 deprecations * pep8 + test fixes * docs typo * Why did I do this? * typo
* Fix some backend feature checks in tests (#4931)David Benjamin2019-07-081-1/+3
| | | | | | | | | | | | | | | * Remove irrelevant DHBackend test conditions DHBackend provides functions for plain finite-field Diffie-Hellman. X25519 and X448 are their own algorithms, and Ed25519 and Ed448 aren't even Diffie-Hellman primitives. * Add missing backend support checks. Some new AES and EC tests did not check for whether the corresponding mode or curve was supported by the backend. * Add a DummyMode for coverage
* add an EC OID to curve dictionary mapping (#4759)Paul Kehrer2019-02-201-1/+7
| | | | | | | | | | * add an EC OID to curve dictionary mapping * oid_to_curve function * changelog and docs fix * rename to get_curve_for_oid
* Simplify string formatting (#4757)Alex Gaynor2019-02-201-3/+3
|
* deprecate encode_point and migrate all internal callers (#4720)Paul Kehrer2019-01-201-1/+2
|
* add support for encoding compressed points (#4638)Paul Kehrer2019-01-201-7/+52
| | | | | | * add support for encoding compressed points * review feedback
* support x448 public/private serialization both raw and pkcs8 (#4653)Paul Kehrer2019-01-131-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * support x448 public/private serialization both raw and pkcs8 * add tests for all other asym key types to prevent Raw * more tests * better tests * fix a test * funny story, I'm actually illiterate. * pep8 * require PrivateFormat.Raw or PublicFormat.Raw with Encoding.Raw * missing docs * parametrize * docs fixes * remove dupe line * assert something
* handle empty byte string in from_encoded_point (#4649)Paul Kehrer2018-12-171-0/+6
| | | | | | * handle empty byte string in from_encoded_point * move the error
* deprecate old from_encoded_point (#4640)Paul Kehrer2018-12-111-12/+16
|
* Compressed point support (#4629)Paul Kehrer2018-12-111-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | * compressed point support * refactor to use oct2point directly * small docs change * remove deprecation for the moment and a bit of review feedback * no backend arg, implicitly import it * missed a spot * double oops * remove superfluous call * use refactored method * use vector file * one last item
* Test for expected CryptographyDeprecationWarnings (#4372)Tim Burke2018-07-281-17/+12
| | | | | | | The remaining calls to `signer()` and `verifier()` are exercising the deprecated API intentionally. Let's test that the deprecation warnings are being raised as expected. Closes #4311; see also #4314.
* improve skip msg when skipping an ECDH test in test_ec (#4355)Paul Kehrer2018-07-181-2/+2
|
* Fixes #4242 -- added an additional assert to make this test more resillient ↵Alex Gaynor2018-07-041-0/+2
| | | | (#4308)
* parametrize a few things in test_ec (#4268)Paul Kehrer2018-05-301-30/+13
|
* Validate the public/private halves of EC keys on import. (#4241)David Benjamin2018-05-141-3/+3
| | | | | | | | | | | | | | | | | | * Validate the public/private halves of EC keys on import. OpenSSL's API is a little finicky. If one sets the public key before the private key, it does not validate that they match. If set in the other order, it does validate this. In particular, KASValidityTest_ECCStaticUnified_NOKC_ZZOnly_init.fax describes error code 7 as: Result = F (7 - IUT's Static private key d changed-prikey validity) Reordering the two operations makes those tests to fail on key import, which is what CAVP appears to have intended. * Wrap to 79 rather than 80 columns
* Brainpool curves (#4129)Paul Kehrer2018-03-151-1/+28
| | | | | | | | | | | | | | | | | | * added brainpool ec-curves key_length >= 256bit * limit brainpool curves to the set that appear required + docs * oops * typos all around me * add brainpool ECDH kex tests * switch to using rfc 7027 vectors * review feedback * empty commits are the best
* update the ec tests to not emit 3000 warnings (#4048)Alex Gaynor2017-12-101-11/+12
|
* Use a different warning class so users get warnings (#4014)Alex Gaynor2017-11-111-4/+5
| | | | | | | | | | | | * Use a different warning class so users get warnings * fixed tests * do our own warning class * typo * flake8
* Fix a few new flake8 issues (#4008)Alex Gaynor2017-11-021-1/+0
|
* deprecate signer/verifier on asymmetric keys (#3663)Paul Kehrer2017-06-031-2/+4
| | | | | | * deprecate signer/verifier on asymmetric keys * review feedback, switch deprecated_call to work around a bug
* make signature and verification contexts error better re: prehashed (#3658)Paul Kehrer2017-06-021-0/+16
| | | | | | * make signature and verification contexts error better re: prehashed * code review feedback
* add convenience methods for key_size on EC{Public,Private}Key (#3587)Paul Kehrer2017-05-231-0/+9
|
* Fixes #3538 -- Make our OpenSSL EC verifier's implementation match the API ↵Alex Gaynor2017-05-101-1/+1
| | | | | | | | | | | | | | (#3539) * Document our real API for EC verification, not an accident * formatting consistency * fix the code itself * fixed class name * fixed a test too
* error if private_value is <= 0 in ec.derive_private_key (#3273)Paul Kehrer2016-11-211-0/+3
|
* add support for prehashing in ECDSA sign/verify (#3267)Paul Kehrer2016-11-201-1/+67
| | | | | | * add support for prehashing in ECDSA sign/verify * move signature_algorithm check to its own function
* add ec.private_key_from_secret_and_curve (#3225)Ofek Lev2016-11-111-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* One shot sign/verification ECDSA (#3029)Aviv Palivoda2016-07-021-0/+22
| | | | | | | | | | | | | | * 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
* SSH serialization for public keys (#2957)Alex Gaynor2016-06-031-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fixed #2887 -- implement __hash__ on EC numbers classes (#2888)Alex Gaynor2016-04-301-0/+24
|
* Un-double the test doublesAlex Gaynor2016-03-051-6/+2
|
* Write some tests for skip conditions in tests.Alex Gaynor2016-01-101-0/+6
| | | | Without this these branches aren't excersised without 0.9.8, but conceptually they are needed.
* use the non-deprecated name for this functionAlex Gaynor2015-12-191-3/+3
|
* Swapping modified x509 test with modified ec testPeter Hamilton2015-10-301-11/+2
|
* Error cleanly if the public and private keys to an ECDH key exchange are on ↵Alex Gaynor2015-10-281-1/+27
| | | | different curves
* add ellipticcurvepublicnumbers reprPaul Kehrer2015-10-281-0/+5
|
* address review feedbackPaul Kehrer2015-10-281-7/+0
|
* modify approach to use EllipticCurvePublicNumbers methodsPaul Kehrer2015-10-271-0/+74
|
* better place for this testAlex Gaynor2015-10-191-0/+16
|
* removed unused code, and added a testAlex Gaynor2015-10-191-12/+13
|
* be more pro-active in handling invalid keysAlex Gaynor2015-10-181-23/+27
|
* unusedAlex Gaynor2015-10-171-6/+0
|
* a refactor to the APIAlex Gaynor2015-10-171-53/+41
|
* Add an Elliptic Curve Key Exchange Algorithm(ECDH)Simo Sorce2015-10-171-1/+93
| | | | | | | | | 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>
* Catch Invalid X or Y points and raise a ValueErrorSimo Sorce2015-10-121-0/+29
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* skip if check on ec testPaul Kehrer2015-08-121-1/+2
|
* Enforce signature type in ECDSA and add testsStanisław Pitucha2015-08-121-0/+9
| | | | | Ensure that ECDSA signatures are bytes to match RSA/DSA and add tests for all three.
* require serialization in asym testsPaul Kehrer2015-06-271-36/+5
|
* fix ec_cdata_to_evp_pkey bugPaul Kehrer2015-06-221-0/+18
| | | | | | We weren't actually returning the object and the tests weren't catching it because we didn't try to use the evp_pkey property in the tests. The added test confirms it actually works.
* add support for secp256k1Paul Kehrer2015-05-081-4/+11
|
* support DER encoded EC private key serializationPaul Kehrer2015-03-131-12/+93
|