Commit Graph

437 Commits (817e5eb0d44620e8d9cfe03c363682fc1e6f698a)

Author SHA1 Message Date
David Núñez 204f295bfb Expected length of signature depends on its group order, not field order 2018-08-15 22:34:21 -05:00
David Núñez 08d6b9d44f Fix incorrect type annotations in pre.Capsule and Curve 2018-08-15 22:33:54 -05:00
David Núñez bbd3d8ec86 Remove unused call to get_affine_coords in Point.to_bytes 2018-08-06 20:29:04 -05:00
David Núñez ff49551360 Change Point.from_bytes to rely directly in OpenSSL EC_POINT_oct2point 2018-08-06 20:29:04 -05:00
David Núñez c394e72e7c Change CurveBN.expected_bytes_length to use the curve group order size 2018-08-06 20:29:04 -05:00
David Núñez b84c83ed44 Introduce curve.group_order_size_in_bytes (different from field order) 2018-08-06 20:29:04 -05:00
David Núñez 1a47ce8493 Use number of bytes returned by BN_bn2bin as ffi.buffer size
The problem is that ffi.buffer fills memory "justified to the left", so e.g., if the BN is 1, the buffer is 010000....00, and we want 00...000001
2018-08-06 20:29:04 -05:00
David Núñez d0b9dc7c8d Use OpenSSL point conversion form constants 2018-08-06 20:29:04 -05:00
David Núñez 3b145892c9 Use OpenSSL primitives in Point.to_bytes 2018-08-06 20:29:04 -05:00
David Núñez 841719c28e Added openssl._bn_to_bytes, to transform BIGNUMs to bytes 2018-08-06 20:29:04 -05:00
David Núñez 4f63089226 Deserialize BIGNUMs with new method, instead of int.from_bytes 2018-08-06 20:29:04 -05:00
David Núñez 92034134ca Make openssl._bytes_to_bn curve-agnostic 2018-08-06 20:29:04 -05:00
David Núñez e1728149f7 Additional size checks in the input of openssl._bytes_to_bn 2018-08-06 20:29:04 -05:00
David Núñez 7e1565ee54 Introduce openssl._bytes_to_bn method 2018-08-06 20:29:04 -05:00
David Nuñez 9d87da3c30 Remove UmbralPublicKey.get_pubkey method 2018-08-04 11:25:58 -05:00
David Núñez cd18086b1b pre.reencrypt raises KFrag.NotValid when necessary 2018-08-03 22:24:21 -05:00
David Núñez 26821a9cb2 New method KFrag.verify_for_capsule. Takes correctness keys from capsule 2018-08-03 22:24:21 -05:00
David Núñez 41197fa423 Introduce KFrag.NotValid exception for invalid KFrags 2018-08-03 22:24:21 -05:00
tuxxy d9caff48f8 Add license headers 2018-07-25 11:55:12 -06:00
David Núñez 58960c553b
Merge pull request #200 from KPrasch/master
Reflow curve interface
2018-07-23 11:16:54 +02:00
Kieran Prasch 3da35827ba Increases test accuracy/coverage supported curves; Includes RFC responses. 2018-07-21 14:47:25 -07:00
Kieran Prasch d0ba7b5567 add init-time property cache for curve field order size (in bytes); Rename method respectively. 2018-07-21 14:16:15 -07:00
Kieran Prasch 4c0fee3973 Treat field order size as cached attribute 2018-07-20 12:56:52 -07:00
Kieran Prasch 32b419af11 Revise alternate curve constructor; Immutably cache curve metadata 2018-07-20 12:56:09 -07:00
Kieran Prasch 1872647a15 Reverse supported curve whitelist k/v 2018-07-20 12:54:09 -07:00
David Núñez 6846f3bafc Use params.curve.__eq__ method in params.__eq__ 2018-07-20 09:57:09 +02:00
David Núñez 646dfb3b26 Fix potential attacks when label or data are empty byte strings 2018-07-20 09:57:09 +02:00
David Núñez 083a4fb685 unsafe_hash_to_point now can output negative points 2018-07-20 09:57:09 +02:00
David Núñez c41eaf0549 Fix bug in unsafe_hash_to_points when label is None, by using defaults 2018-07-20 09:57:09 +02:00
Kieran Prasch 12fc13c9a3 Reflow curve interface 2018-07-19 15:41:25 -07:00
Tux ef2ff044d8
Merge pull request #192 from cygnusv/curvebn-ops
Minor improvements to CurveBN
2018-07-17 11:02:25 -06:00
David Núñez 014c46cad8 Rename Point.__inverse__ as __neg__ according to the additive notation 2018-07-16 16:18:16 +02:00
David Núñez d645d75b2b Fix previous bug in Point.from_affine and Point.from_bytes 2018-07-16 16:13:35 +02:00
David Núñez f018079251 Some refinement in lambda_coeff and poly_eval, from umbral.utils 2018-07-13 02:26:04 +02:00
David Núñez f17b2419c4 Some type annotations for CurveBN 2018-07-13 02:26:04 +02:00
David Núñez b5b3513707 Support for int arguments in CurveBN.__add__ and __sub__ 2018-07-13 02:26:04 +02:00
David Núñez 3eb66de507 Fix memleak in CurveBN.truediv 2018-07-13 02:26:04 +02:00
David Núñez d5bc44d01a Modular opposite for CurveBN
"I'm the opposite of every guy you've ever met"
2018-07-13 02:26:04 +02:00
David Núñez 2075082ef6 Update 'NuCypherKMS' to 'NuCypher' 2018-07-13 02:26:04 +02:00
David Núñez d7c31475b8 Remove forward references to 'CurveBN' 2018-07-13 02:26:04 +02:00
David Núñez 66c5078ed0 Refactor get_field_order_size_in_bytes as a Curve method 2018-07-13 02:26:04 +02:00
jMyles c46785ca17 Constant time comparison for KFrag. 2018-07-12 02:35:16 -07:00
jMyles 1aaaf7866c Using _id for KFrag __hash__ instead of full bytes. Also test for the same. Also lots of cleanup. 2018-07-12 02:34:01 -07:00
jMyles aeab6e93af expected_bytes_length can now take is_compressed. test for casting UmbralPublicKey.to_bytes() with is_compressed. 2018-07-12 02:27:05 -07:00
jMyles 9f7a0e10f8 Adds is_compressed to UmbralPublicKey.to_bytes() 2018-07-12 02:22:31 -07:00
Kieran Prasch 19b1991de6 Hand-picked type data to follow-up monkeytype 2018-07-09 12:26:32 -06:00
Kieran Prasch befb0c30d7 skip openssl type checks; update mypy ini config. 2018-07-09 12:13:40 -06:00
Kieran Prasch 2fe18c7144 Initial bulk application of type hints to pyUmbral 2018-07-09 12:11:43 -06:00
tuxxy 4a20ef0692 Add __repr__ for Curve object 2018-07-07 13:56:07 -06:00
tuxxy a717a87384 Use singleton model for curves; allow users to import instances 2018-07-07 13:56:07 -06:00