Commit Graph

437 Commits (817e5eb0d44620e8d9cfe03c363682fc1e6f698a)

Author SHA1 Message Date
tuxxy c4c0d93b05 Switch to cryptography.io ChaCha20-Poly1305 AEAD 2018-01-24 14:34:14 -07:00
tuxxy b1f04f7d54 Calculate recipient public key from recipient's private key in decrypt_reencrypted 2018-01-23 13:50:14 -07:00
tuxxy 3eafb28897 Add tests and fix a few things 2018-01-23 04:28:51 -07:00
tuxxy 250cf3c0ee Add simple API 2018-01-23 03:13:08 -07:00
tuxxy 74f989e887 Use basic DEM principles
Had a call with David, we discussed how we're implemting the needed API
changes. We're going to use Umbral for Michael's API request. This DEM
will be kept simple and simply use NaCl Salsa20-Poly1305 SecretBox.

Add KEYSIZE attr on UmbralDEM
2018-01-23 02:46:01 -07:00
tuxxy 3a8f4c81cd Add skeleton of DEM 2018-01-23 00:40:36 -07:00
tuxxy 8cce1816fe Add gen_key classmethods to UmbralPrivateKey and UmbralPublicKey
Actually return key
2018-01-23 00:33:34 -07:00
tuxxy 0131fb866f Undo DH derivation via affine 2018-01-22 12:01:58 -07:00
tuxxy 0104492e16 Use compressed point in KDF 2018-01-22 11:58:10 -07:00
tuxxy 428e9340c4 Merge DH fixes 2018-01-19 16:48:49 -07:00
tuxxy dd37964394 Implement save_key method on UmbralPublicKey 2018-01-19 06:08:39 -07:00
tuxxy de56b5a033 Implement method save_key for UmbralPrivateKey with key encryption using Scrypt-Salsa20-Poly1305 2018-01-19 06:08:39 -07:00
tuxxy 03d2a678cf Implement classmethod load_key for UmbralPrivate/PublicKey classes 2018-01-19 06:08:39 -07:00
tuxxy 8b5fec3fdb Add skeleton UmbralPrivateKey and UmbralPublicKey objects 2018-01-19 06:08:39 -07:00
tuxxy 716c4a3b45 Use additive notation for scalar multiplication
Fix spacing

Use vector notation on consistency check
2018-01-19 06:07:59 -07:00
tuxxy 0036d73891 Implement __rmul__ on Point and add type checking in BigNum.__mul__ 2018-01-18 00:31:15 -07:00
David Nuñez 599bad38b3 Include pub_a and pub_b as input to the kFrag signature to avoid
potential reuse of kFrags from other RKs (i.e., not from A to B)
2018-01-17 17:54:37 +01:00
David Nuñez 97340ec0c5 Updated variable names to include type 2018-01-17 11:37:34 +01:00
tuxxy 5939000a52 Add typehinting for curve objects 2018-01-16 11:24:54 -07:00
tuxxy 3817109ae0 Use staticmethods for from_bytes methods 2018-01-16 11:17:41 -07:00
tuxxy 763a7271c7 Fix naming from KFrag.point_key to KFrag.bn_key 2018-01-16 11:08:13 -07:00
tuxxy 8555d36f9b Use EC_POINT_clear_free instead of EC_POINT_free 2018-01-15 17:24:38 -07:00
tuxxy 2cdfbf1869 Use BN_clear_free instead of BN_free 2018-01-15 17:24:21 -07:00
tuxxy fa0e3eba09 Add serialization/deserialization methods for ChallengeResponse 2018-01-15 17:11:29 -07:00
tuxxy f418c728f3 Add serialization/deserialization methods for ReconstructedCapsule 2018-01-15 15:57:14 -07:00
tuxxy 632538707c Add serialization/deserialization methods for Capsule
Fix names
2018-01-15 15:48:54 -07:00
tuxxy 3b21a91ce0 Add serialization/deserialization methods to CapsuleFrag 2018-01-15 15:32:18 -07:00
tuxxy df43bc3dd7 Add serialization methods to KFrag
Fix point_key deserialization to use BigNum
2018-01-15 15:06:25 -07:00
David Nuñez 1294cd4d32 Removed old comments 2018-01-10 16:15:41 +01:00
David Nuñez 381fe19b82 UmbralParameters are fixed before initialization of PRE 2018-01-10 16:14:00 +01:00
David Nuñez 9aedb37acc Added random h and u 2018-01-10 16:09:08 +01:00
David Nuñez 620bec85f8 Changed check_original to Capsule method (verify).
Renamed KFrag.check_signature to verify.
2018-01-10 15:57:53 +01:00
David Nuñez 146e139409 Changed check_kFrag_signature to a KFrag method (check_signature) 2018-01-10 15:52:43 +01:00
David Nuñez 63385d5fd4 Moved KDF to utils 2018-01-10 15:48:33 +01:00
David Nuñez ba3395728d Moved hash_to_bn to utils, and changed check_kfrag_consistency as a
KFrag method
2018-01-10 15:42:34 +01:00
David Nuñez 6d70c80541 Added cFrag list and capsule reconstruction to Capsule. Had to comment
most tests for a while because of the syntax changes
2018-01-09 11:02:53 +01:00
jMyles dcd9b37d29 Changing argument order (keys first, capsule(s) second). Added type hint for ReconstructedCapsule. 2018-01-03 13:36:17 -05:00
jMyles 9b8bd2c235 Merge commit for naming changes contemporaneously made by @cygnusv. 2018-01-03 13:01:35 -05:00
jMyles e651b66f9f Type hints for decapsulate. 2018-01-03 12:47:15 -05:00
jMyles 90e284b4d8 ctxt_combined -=> capsule 2018-01-03 12:27:27 -05:00
jMyles fcadb3b2ab Some thoughts from my linter. :-) 2018-01-03 12:27:08 -05:00
David Nuñez 4b9f395f84 some renaming of internal variables, still a lot pending. 2018-01-03 01:33:39 +01:00
David Nuñez d40429b642 Renamed variables inside Capsule to improve readability 2018-01-02 11:25:34 +01:00
David Nuñez b67f85d05e Added check_kFrag_consistency method 2018-01-02 10:43:23 +01:00
David Nuñez 3969ee3948 some name changes as per #7 2017-12-30 01:18:23 +01:00
David Nuñez ce4abae06d RekeyFrag —> KFrag (issue #4) 2017-12-30 00:06:21 +01:00
tuxxy 741c76154c
Merge branch 'master' of github.com:nucypher/nucypher-kms-umbral 2017-12-28 18:36:46 -07:00
tuxxy 2b0fe1a9ea
Standardize compressed point serialized form with 0x02 and 0x03 2017-12-28 18:36:36 -07:00
David Nuñez 73a6169806 Test invalid points in the curve 2017-12-29 01:39:28 +01:00
David Nuñez 3673e35021 Added re-encrypt, combine, decapsulate_reencrypted, challenge, and
check_challenge
2017-12-29 01:13:16 +01:00
tuxxy f7f9585da6
Use keysize from curve object where possible and perform length checking 2017-12-28 15:27:37 -07:00
tuxxy 9311c90b71
Raise ValueError if could not determine compressed or uncompressed point 2017-12-28 13:12:31 -07:00
tuxxy fe67072172
Implement class method from_bytes on Point which allows for compressed and uncompressed points 2017-12-28 13:03:44 -07:00
tuxxy fb097ec88d
Add from_bytes method on BigNum
Clean up some methods in BigNum
2017-12-28 12:38:16 -07:00
tuxxy eac72d5945
Add to_bytes method for BigNum 2017-12-28 12:30:21 -07:00
tuxxy 8cc120e8c1
Implement Point compression in to_bytes method 2017-12-28 12:20:01 -07:00
tuxxy 125721ddc8
Add some PEP8 fixes 2017-12-28 11:53:09 -07:00
David Nuñez 368dbe4c52 Fixed hash_to_bn 2017-12-28 15:02:53 +01:00
David Nuñez f5791207be Fixed bug in from_int 2017-12-28 13:09:58 +01:00
David Nuñez bcc593f1ab Basic stuff (encapsulate & decapsulate, hash_to_bn, etc) 2017-12-28 02:07:37 +01:00
David Nuñez 971cec3f73 added to_affine and to_bytes to Point 2017-12-28 02:07:00 +01:00
David Nuñez 07a6e4bb6b Changed __div__ to div modulo the order of the curve 2017-12-27 18:02:53 +01:00
tuxxy b5b44f6cdc
Implement class method get_order_from_curve on Point 2017-12-27 07:41:39 -07:00
tuxxy 912fe49427
Implement class method get_generator_from_curve on Point 2017-12-27 07:37:50 -07:00
tuxxy f22622bece
Add lambda_coeff and poly_eval math utility functions to utils
Fix syntax to be more uniform
2017-12-27 07:29:59 -07:00
tuxxy 9c33357e38
Add empty utils.py file 2017-12-27 07:14:42 -07:00
tuxxy d65829f977
Add empty pre.py file 2017-12-27 07:08:52 -07:00
tuxxy 743f90e665
Implement __eq__ on Point 2017-12-27 07:03:49 -07:00
tuxxy 337a78851b
Implement __sub__ on Point 2017-12-27 06:58:43 -07:00
tuxxy f076da6518
Implement __invert__ on Point 2017-12-27 06:56:31 -07:00
tuxxy d1e25d3b1d
Implement __add__ on Point 2017-12-27 06:52:48 -07:00
tuxxy eda645cfb6
Implement __mul__ on Point 2017-12-27 06:47:32 -07:00
tuxxy 8350e84378
Implement class method from_affine on Point 2017-12-27 06:28:25 -07:00
tuxxy fb51c0b7c7
Create Point class and implement class method gen_rand 2017-12-27 05:57:11 -07:00
tuxxy 7946b96117
Implement __eq__ on BigNum 2017-12-27 05:25:42 -07:00
tuxxy 41ab6080fb
Implement __pow__ with integer handling for __pow__ and __mod__ 2017-12-27 04:56:40 -07:00
tuxxy 6023933e54
Implement __mod__ for BigNum 2017-12-27 04:23:03 -07:00
tuxxy 29d8457029
Fix dunder operator usage for invert and division 2017-12-27 04:20:40 -07:00
tuxxy c4bc668931 Add class method from_int 2017-12-24 12:57:02 -07:00
tuxxy 77fb96a051 Implement __sub__ on BigNum 2017-12-24 12:45:30 -07:00
tuxxy f254154dc5 Implement __add__ on BigNum 2017-12-24 12:42:33 -07:00
tuxxy 3a99b8e4c5 Implement __inv__ on BigNum 2017-12-24 12:39:44 -07:00
tuxxy e9162b2a06 Implement __div__ on BigNum 2017-12-24 12:34:48 -07:00
tuxxy 37ca2f3d54 Implement __mul__ on BigNum 2017-12-24 12:31:18 -07:00
tuxxy 823dd8d794 Add BigNum class method gen_rand 2017-12-24 12:21:06 -07:00
tuxxy 115816b5c9 Add empty files for bignum and point 2017-12-23 13:28:05 -07:00
tuxxy 99f1d8475b Create umbral package 2017-12-23 13:17:40 -07:00