Commit Graph

511 Commits (bench-kdf)

Author SHA1 Message Date
David Núñez e81d44498a
Merge pull request #138 from cygnusv/constant_time_hash_to_bn
Remove loop in CurveBN.hash()
2018-05-05 11:23:11 +02:00
jMyles c5fbcc3a1c Moving exception inside if block; testing it. 2018-05-05 11:15:40 +02:00
David Nuñez 38d632c166 Deterministic version of CurveBN.hash() 2018-05-05 00:58:04 +02:00
Justin Holmes 5e0394cbc1
Merge pull request #131 from cygnusv/constant_time_hash_to_bn
Constant time `hash_to_bn` (and some minor cleaning)
2018-05-02 14:45:37 -07:00
tuxxy 3a5daa3e76 Unnest context manager 2018-05-01 18:22:38 -06:00
tuxxy a6c4b669a2 Merge branch 'consttime-ops' of github.com:tuxxy/pyUmbral into consttime-ops 2018-05-01 18:15:01 -06:00
tuxxy d3919ecdf6 Move try/finally outside of with; is_consttime -> set_consttime_flag; Make docstrings more clear 2018-05-01 18:14:25 -06:00
Tux 44c15e5bfb
Merge branch 'master' into consttime-ops 2018-05-01 18:04:55 -06:00
tuxxy b16ea6f303 Make _tmp_bn_mont_ctx only return a BN_MONT_CTX 2018-05-01 17:58:17 -06:00
tuxxy b926f7ccc8 Add docstrings for constant time operations 2018-05-01 17:58:17 -06:00
tuxxy e7fe202a92 Add consttime flag when creating new BNs 2018-05-01 17:58:17 -06:00
tuxxy 96d6b553a1 Make openssl _bn_is_on_curve vars more clear; check if randomly generated bn is on curve; update CurveBN docstring 2018-05-01 17:58:17 -06:00
tuxxy 024944627e Improve docstrings a bit 2018-05-01 17:58:17 -06:00
tuxxy b2182c5f2c Include y-byte in Point.get_size 2018-05-01 17:58:17 -06:00
tuxxy 5b41cd65bf Use better method for determining keysize in bytes (thanks @cygnusv) 2018-05-01 17:58:17 -06:00
tuxxy b39a8a57f0 Remove __hash__ on CurveBN and make Capsule._attached_cfrags a list
Remove unused Capsule._contents
2018-05-01 17:58:17 -06:00
tuxxy 32c5f542e6 Add get_size classmethods for CurveBN, Point, fragments, and
CorrectnessProof.

Fix syntax error
2018-05-01 17:58:17 -06:00
tuxxy fd1ab49655 Cache pubkey on UmbralPrivateKey for #121 2018-05-01 17:58:17 -06:00
tuxxy dc2bfbb48a Rename BigNum -> CurveBN
Change all references from BigNum to CurveBN
2018-05-01 17:58:17 -06:00
tuxxy 0b8c6ca936 Implement OpenSSL module in BigNum, Point, and key classes 2018-05-01 17:58:17 -06:00
tuxxy 861a1a2be2 Create openssl module and add OpenSSL helper utilities
Use BN_cmp instead of BN_is_zero since it's not exposed

Add EC_POINT operations to openssl module
2018-05-01 17:58:17 -06:00
David Nuñez aeb8ad3298 Fix calls to CurveBN.hash() 2018-05-02 01:25:42 +02:00
David Nuñez d0eecfb9c5 Improved version of CurveBN.hash_to_bn(), now called CurveBN.hash() 2018-05-02 01:25:42 +02:00
David Nuñez a73ad4a37b Raise ValueError in CurveBN constructor if the bignum is not in the curve 2018-05-02 01:25:42 +02:00
David Nuñez 0b2e69749c Use Blake2b instead of SHA256 in unsafe_hash_to_point 2018-04-30 03:45:23 +02:00
David Nuñez 4036cdc8b0 Use cls instead of class name in class methods 2018-04-30 03:41:34 +02:00
David Nuñez e57cb01c23 Removed Point.get_order_from_curve 2018-04-30 03:33:56 +02:00
David Nuñez 197f08908b Remove params.CURVE_MINVAL_HASH constant 2018-04-30 03:30:42 +02:00
David Nuñez 08a9a41aad Constant-time version `CurveBN.hash_to_bn` 2018-04-30 02:56:26 +02:00
David Nuñez ce3caf9dfb Remove unused import hmac 2018-04-30 00:19:35 +02:00
tuxxy 8261399a76 Make openssl _bn_is_on_curve vars more clear; check if randomly generated bn is on curve; update CurveBN docstring 2018-04-25 14:03:01 -06:00
tuxxy 7eec2a0c75 Improve docstrings a bit 2018-04-24 17:02:23 -06:00
tuxxy 2b8fe610ca Include y-byte in Point.get_size 2018-04-24 16:54:11 -06:00
tuxxy 92ec0f2a8c Use better method for determining keysize in bytes (thanks @cygnusv) 2018-04-24 16:52:09 -06:00
tuxxy 6c2dd86522 Remove __hash__ on CurveBN and make Capsule._attached_cfrags a list
Remove unused Capsule._contents
2018-04-24 16:39:20 -06:00
tuxxy 150714fb00 Add get_size classmethods for CurveBN, Point, fragments, and
CorrectnessProof.

Fix syntax error
2018-04-24 16:28:01 -06:00
tuxxy 2dfb69e6b5 Cache pubkey on UmbralPrivateKey for #121 2018-04-24 12:41:42 -06:00
tuxxy 923ad2944f Rename BigNum -> CurveBN
Change all references from BigNum to CurveBN
2018-04-24 12:41:40 -06:00
tuxxy 6a1cb6832c Implement OpenSSL module in BigNum, Point, and key classes 2018-04-24 12:27:09 -06:00
tuxxy 920b705640 Create openssl module and add OpenSSL helper utilities
Use BN_cmp instead of BN_is_zero since it's not exposed

Add EC_POINT operations to openssl module
2018-04-24 12:24:20 -06:00
David Nuñez 63f63b4235 Big renaming 2018-04-24 10:42:10 -07:00
David Nuñez 02ea0aaf3b Added `check_proof` parameter to pre.decrypt 2018-04-24 10:21:43 +02:00
David Nuñez 4304a7da40 Improve readability of valid_kfrag_signature check 2018-04-24 01:18:26 +02:00
David Nuñez 12c6b5edd9 Make use of short-circuit logic 2018-04-24 00:55:48 +02:00
David Nuñez 7d9bc19fc4 Fix call to hash_to_bn 2018-04-23 23:13:11 +02:00
David Nuñez f1a847d219 Merge remote-tracking branch 'nucypher/master' into cfrags-with-correctness-proof
# Conflicts:
#	umbral/pre.py
2018-04-23 22:58:52 +02:00
David Nuñez 267e6ea383 Fix problem with serialization of proofs when optional 2018-04-23 00:09:22 +02:00
David Nuñez cb326488c9 Correctness proofs are now optional, although default setting is True 2018-04-22 23:43:39 +02:00
David Nuñez f646fdc241 More informative names in _verify_correctness() 2018-04-22 23:34:13 +02:00
David Nuñez b714f47d10 Some renaming 2018-04-19 13:14:33 +02:00
David Nuñez b725a5e9ac pre._verify_correctness_proof() --> pre._verify_correctness() 2018-04-19 13:00:19 +02:00
David Nuñez 159b2dd720 Merge remote-tracking branch 'nucypher/master' into cfrags-with-correctness-proof 2018-04-19 00:23:48 +02:00
David Nuñez fca002632e Enter UmbralCorrectnessError 2018-04-18 22:59:27 +02:00
David Nuñez 88961b35d3 Reformat 2018-04-18 22:40:05 +02:00
David Nuñez 0e064c4046 Now re-encryption correctness is always verified during decryption 2018-04-18 15:14:10 +02:00
David Nuñez 094b8c9e0c Remove metadata as parameter of pre.verify_correctness_proof() 2018-04-18 12:00:09 +02:00
David Nuñez 72a9e7be06 Include metadata inside the CorrectnessProof 2018-04-18 11:37:40 +02:00
tuxxy dbbc11873a Fix flow of hash_to_bn 2018-04-18 00:37:37 -06:00
David Nuñez 274699b2a1 Proofs are now part of CFrags so we can drop it as an argument to _verify_correctness_proof 2018-04-18 00:10:10 +02:00
tuxxy 4a244a01a3 Use arg packing in hash_to_bn and check if item is bytes before hashing
Use default_params
2018-04-17 14:57:33 -06:00
tuxxy 0fd530b74f Add hash_to_bn as a classmethod on BigNum 2018-04-17 13:15:12 -06:00
David Nuñez a03837dc72 More renaming 2018-04-17 13:02:04 +02:00
David Nuñez 3610004773 pre._check_challenge() --> pre._verify_correctness_proof() 2018-04-17 12:43:08 +02:00
David Nuñez e275cb66c6 pre._challenge() --> pre._prove_correctness 2018-04-17 12:29:44 +02:00
David Nuñez 1a8bb867ae Refactored pre.ChallengeResponse into fragments.CorrectnessProof 2018-04-17 12:17:14 +02:00
David Nuñez b5eab0b6ec Restore inherit from object 2018-04-16 23:55:32 +02:00
David Nuñez ebd141a2f0 Default keying material is 64 bytes 2018-04-16 23:48:19 +02:00
David Nuñez 6fb62f5c8e Removed AbstractUmbralKeyingMaterial class 2018-04-16 23:44:43 +02:00
David Nuñez 53c10bc300 Reverted changes to `hash_to_bn` 2018-04-16 23:25:25 +02:00
David Nuñez ae95441b35 derive_private_key_from_label --> derive_privkey_by_label 2018-04-16 23:08:04 +02:00
David Nuñez 4818c00bfb Merge remote-tracking branch 'nucypher/master' into derive-keys-from-labels
# Conflicts:
#	tests/test_keys/test_umbral_keys.py
#	umbral/keys.py
2018-04-16 23:00:29 +02:00
David Nuñez 16498e2058 Some documentation for UmbralKeyingMaterial 2018-04-16 13:04:37 +02:00
David Nuñez 3cb91cc981 Enter class UmbralKeyingMaterial 2018-04-16 12:44:04 +02:00
David Nuñez c83e706f8a Generic method to handle password-protected key material 2018-04-16 11:45:29 +02:00
David Nuñez ed2ab9dbb0 Abstract class for UmbralKeyingMaterial
This class generalizes current UmbralPrivateKey and the upcoming
UmbralKeyingMaterial
2018-04-16 11:13:01 +02:00
jMyles 94ff3d310d UmbralPublicKey: Better __eq__ and implementing __hash__. 2018-04-14 08:59:37 -07:00
tuxxy 75846e901f Merge branch 'add-encoder-param' of github.com:tuxxy/pyUmbral into add-encoder-param 2018-04-11 19:54:21 -06:00
tuxxy b6d0915970 Update docstrings 2018-04-11 19:50:46 -06:00
Tux b1b4cf5d59
Merge branch 'master' into add-encoder-param 2018-04-11 19:32:08 -06:00
Kiko Fernandez Reyes 4f28bdea6d correction of staticmethod to classmethod 2018-04-11 13:25:49 +02:00
tuxxy 7d89cef9df Add encoder/decoder params to to_bytes/from_bytes functions
Fix syntax issues
2018-04-10 17:09:38 -06:00
David Nuñez 4cebe81631 Remove commented breakpoint 2018-04-09 12:15:48 +02:00
David Nuñez f03b8a8422 Add derive_key_from_label function to UmbralPrivateKey (solves #98) 2018-04-09 12:03:55 +02:00
David Nuñez b14ffc0746 Refine hash_to_bn to rely on isinstance instead of AttributeErros 2018-04-09 12:02:48 +02:00
jMyles caea15cb7a Fixing parameter order and cleaning up some imports. 2018-04-02 19:00:41 -07:00
tuxxy 34807581e6 Inject params on encrypt, decrypt, and open_capsule 2018-04-02 18:16:43 -07:00
jMyles a6b80b071e __eq__ for UmbralPublicKeys. 2018-04-01 23:56:34 -07:00
David Nuñez 42e75127ac k_frag, c_frag --> kfrag, cfrag 2018-03-28 20:59:28 -07:00
David Nuñez 6c21481c3d Missing comment 2018-03-27 19:15:58 -07:00
David Nuñez de214cbcc0 Fix collateral damage of a replace-all 2018-03-27 19:15:58 -07:00
Tux 1d02c050b2
Merge branch 'master' into master 2018-03-21 02:07:12 -04:00
tuxxy 6e687bbccb Generate a random BigNum within the order of the curve using BN_rand_range 2018-03-19 13:22:41 -06:00
Tux 317548e075
Merge pull request #16 from tuxxy/ssl-clear-free
Implement BN_clear_free and EC_POINT_clear_free. Awaiting upstream release for cryptography.io
2018-03-19 02:55:38 -04:00
David Nuñez 010daae066 Made pre.challenge and pre.check_challenge private 2018-03-18 01:53:32 +01:00
David Nuñez 5be059770e Made _decapsulate_reencrypted private 2018-03-18 01:49:52 +01:00
David Nuñez 0639854a85 Changed order of arguments in pre.decrypt() 2018-03-18 01:48:05 +01:00
David Nuñez 17467431ca Dropped pre.gen_priv() and pre.priv2pub()
Resolves #90
2018-03-15 11:07:56 +01:00
David Nuñez 5bd0503ca8 Improvements to the tests 2018-03-14 12:00:04 +01:00
David Nuñez 3990b7a499 Fixed notation of scalar multiplication operations 2018-03-14 10:37:41 +01:00
David Nuñez a66cf59c48 SHA512 --> BLAKE2b
Resolves #60
2018-03-13 15:43:25 +01:00
David Nuñez 43d1ab206b Added metadata as optional input to the challenge protocol 2018-03-13 15:33:23 +01:00
David Nuñez dda693450e KFrag ids can only be computed by Bob now 2018-03-13 13:08:30 +01:00
tuxxy ec88c7b856 Use better result names for OpenSSL calls in to_cryptography_pubkey (thanks, @jmyles) 2018-03-08 13:22:02 -07:00
tuxxy e57473b70c Reduce verbosity of names 2018-03-08 13:21:33 -07:00
jMyles 9c348eb9df Cleaner names for OpenSSL operations and results. Also, closing the context manager when it's no longer needed. 2018-03-08 09:54:18 -08:00
tuxxy 1d96f84fca Uses a constant CHAHCA20_KEY_SIZE instead of unused SecretBox constant 2018-03-07 18:37:33 -07:00
tuxxy 9578a3d52e Remove to_cryptography_pub_key and to_cryptography_priv_key on bignum and point 2018-03-07 18:30:25 -07:00
tuxxy aada52b392 Implement to_cryptography_pubkey/privkey in keys.py 2018-03-07 18:29:41 -07:00
David Nuñez 82e9117e8f Comments in KFrag.verify() 2018-02-27 10:08:03 +01:00
David Nuñez 1678a6cc27 Some changes to variable names 2018-02-27 09:08:27 +01:00
David Nuñez c1a30c3056 Removed KFrag consistency checks (#77) 2018-02-26 15:36:56 +01:00
David Nuñez 5534a3a838 Missing check in KFrag.verify() 2018-02-26 10:35:05 +01:00
David Nuñez fba9b0bba1 Original capsule components are now authenticated by the AEAD 2018-02-26 10:29:02 +01:00
David Nuñez 5a5d239ec7 Method _original_to_bytes to get bytes representation of original components of a capsule 2018-02-26 10:26:50 +01:00
David Nuñez e1a3c03184 Missing check in the challenge protocol 2018-02-26 10:05:01 +01:00
jMyles a0edb155e5 Capsule with wrong Type raises TypeError now, not ValueError. 2018-02-22 23:19:47 -08:00
jMyles 2cedc7689e @KPrasch is right - no need for those square brackets. And a test too. 2018-02-22 18:53:34 -08:00
jMyles 0015ca5fcb Back to comparing lists of components for Capsule. 2018-02-22 18:21:30 -08:00
jMyles e0a069bb9a umbral.umbral -=> umbral.pre 2018-02-22 18:21:30 -08:00
jMyles de62d7e03c Capsules are useful as dict keys. 2018-02-22 18:21:30 -08:00
jMyles 0b7a6dc061 Sanity check for Capsule creation (need to be Points). 2018-02-22 11:20:50 -08:00
jMyles 4b8c5dec99 Capsule comparison now in constant time. 2018-02-22 11:20:50 -08:00
jMyles 501f0c4ba6 Changing all implemented instances of get_pub_key() to get_pubkey() 2018-02-13 12:50:44 -08:00
jMyles 4a5ba12e98 Better names in encrypt(). 2018-02-13 12:47:36 -08:00
jMyles 32a63f3c23 Capsule had no __bytes__ (how did this ever work?) 2018-02-13 12:47:21 -08:00
jMyles 73513b0542 repr for PublicKey. 2018-02-13 12:47:13 -08:00
jMyles 6ac95be4cf Sanity check when making a PublicKey from a Point. 2018-02-13 12:47:02 -08:00
jMyles d6527e47fd get_pubkey, not get_pub_key. Also, raising NotImplemented on UmbralPublicKey. 2018-02-13 12:46:28 -08:00
Kieran R Prasch 76f2a985dd Upgrades GenericUmbralError to an exception class; raise capsule.NotValid if capsule verification fails. 2018-02-12 14:48:34 -08:00
Kieran R Prasch 404a2a3ebd Corrects type hint for .split_rekey() dynamic typing (Union). 2018-02-12 13:05:24 -08:00
Kieran R Prasch cb40ec132b Adds type hints to umbrals's functional parameters. 2018-02-12 12:44:07 -08:00
Kieran R Prasch ead4cafe59 Adds type hints and annotations for umbral function return signatures. 2018-02-12 10:51:11 -08:00
Justin Holmes b85bf19e44
Merge pull request #62 from KPrasch/umbral_tests
Reintroduces test sending Ursula a fake k_frag
2018-02-10 22:53:27 -05:00
tuxxy 0d4ad0d3e6 save_key -> to_bytes, load_key -> from_bytes 2018-02-10 20:21:16 -07:00
tuxxy eb194bcf1a Use as_b64 instead of as_bytes 2018-02-10 20:13:31 -07:00
Kieran R Prasch 97cceedc30 Creates opeenssl mocked backend pytest fixture. 2018-02-10 04:49:51 -08:00
tuxxy aa3c11811e Add as_bytes to UmbralPublicKey.load_key 2018-02-09 22:01:15 -07:00
jMyles c67849897c SECP256K! is now default if set_default_config() is run without argument. Also, the curve is returned. 2018-02-09 20:57:17 -08:00
tuxxy b2e2ffcb31 Clarify default_curve error 2018-02-09 21:30:25 -07:00
tuxxy 0cb397bd30 Allow bytes in UmbralPublicKey.load_key 2018-02-09 21:28:50 -07:00
jMyles 0d5ab8a597 Without a default curve, getting the default curve or params now emits a warning (instead of raising an exception) and sets the curve to SECP256K1. 2018-02-08 21:40:02 -08:00
Kieran R Prasch 1cb9aba0a9 Adds a pair of tests for Point.__mul__. 2018-02-08 18:57:59 -08:00
tuxxy efacd03e3e Add to_cryptography_pub_key method to Point and add tests
Fix naming of to_cryptography_pub_key
2018-02-08 17:06:47 -07:00
tuxxy e7d2a53277 Add to_cryptography_priv_key method and test for BigNum 2018-02-08 16:47:24 -07:00
tuxxy f6327da4d9 Take params as second argument in unsafe_hash_to_point 2018-02-08 16:31:54 -07:00
tuxxy c6bbb37b32 domain_seed -> parameters_seed 2018-02-08 16:28:47 -07:00
tuxxy 4154fe1253 Add test for pubkey encryption (encryption for bob) 2018-02-08 15:46:42 -07:00
tuxxy f0af54f416 Move PRE module functions to the top of the file 2018-02-08 15:46:42 -07:00
tuxxy 2b45e73342 Move hash_to_bn and unsafe_hash_to_point to bignum and point modules respectively 2018-02-08 15:46:42 -07:00
tuxxy 8efafb79f8 Create util function to accurately get curve keysize 2018-02-08 15:46:42 -07:00
tuxxy db4842370e Use BytesIO to deserialize fragments based on curve keysize 2018-02-08 15:46:41 -07:00
tuxxy a43f6ab153 Use SHA512, CURVE_KEY_SIZE_BYTES, and CURVE_MINVAL_SHA512 in crypto material hashing functions 2018-02-08 15:46:41 -07:00
tuxxy 6932a88ca1 Add CURVE_KEY_SIZE_BYTES to params 2018-02-08 15:46:41 -07:00
tuxxy bd2af003a1 Add CURVE_MINVAL_SHA512 to params 2018-02-08 15:46:41 -07:00
jMyles b15f3b9b0e Raise class-scoped error instead of RuntimeError. 2018-02-08 11:30:24 -08:00
tuxxy 74b131d2ad Remove PRE class and make it a module and fix tests 2018-02-08 02:30:56 -07:00
tuxxy ec41283ce5 Add default_params to PRE.verify 2018-02-08 02:08:00 -07:00
tuxxy 2818b8b1f4 Add default_params to fragments methods 2018-02-08 02:05:34 -07:00
tuxxy da4f22b57c Use default_curve in all BigNum classmethods 2018-02-08 02:00:08 -07:00
tuxxy eda7d9992f Use default curve in all Point classmethods 2018-02-08 01:58:16 -07:00
tuxxy ef766d8bba Begin moving things over to module with default_params/default_curve 2018-02-07 22:26:38 -07:00
jMyles e1fedf15e1 Example params attribute deprecation. 2018-02-07 21:03:12 -08:00
jMyles 7110017475 default_curve and default_params now in place instead of re-init'ing UmbralParameters() everywhere. 2018-02-07 20:41:05 -08:00
jMyles 59170d4082 PRE (which is soon to be a module anyway) uses default params for testing. 2018-02-07 20:09:47 -08:00
jMyles 3b81c94926 Moved frags to their own module. 2018-02-07 16:20:11 -08:00
jMyles e036a6edf9 Facility for setting default curve. 2018-02-07 16:20:11 -08:00
tuxxy e0a5853ae4 Fix typo _recontruct -> _reconstruct 2018-02-07 03:13:57 -07:00
tuxxy 86cdb5ccca Add __bytes__ to UmbralPublicKey 2018-02-07 03:13:25 -07:00
jMyles 5ed861639c The private key passed to decrypt() might be Bob's *or* Alice's. 2018-02-06 02:20:48 -08:00
jMyles cba6f007f2 The method to make an activated Capsule is now Capsule._reconstruct_shamirs_secret(). 2018-02-02 16:56:13 -08:00
jMyles aabec3f4ce We don't actually "reconstruct" a Capsule. We activate it. 2018-02-01 16:16:12 -08:00
jMyles e3b853cb4d Using character names for encapsulate and related Capsule logic. 2018-02-01 10:21:39 -08:00
jMyles b9c24203cf Removing "PRE" dependency injection into PRE instance. 2018-02-01 09:06:11 -08:00
tuxxy a98d18d084 Set UmbralParameters as an attribute on Umbral keys w/ test updates 2018-02-01 03:21:07 -07:00
tuxxy 512bf91297 Remove manual specification of umbral params in PRE._open_capsule 2018-02-01 01:52:11 -07:00
tuxxy 0d5a68611f Use default UmbralParameters if none were specified for umbral keys 2018-02-01 01:47:41 -07:00
tuxxy bc0f169a43 Move UmbralParameters class to params.py 2018-02-01 01:47:06 -07:00
David Nuñez 8761d7828a Using a common domain_seed 2018-01-31 16:46:35 +01:00
David Nuñez c79b537e01 Changed "constant" to "label" in unsafe_hash_to_point 2018-01-31 16:46:35 +01:00
David Nuñez ba2a93e9bf Remove the try-except-pass pattern using more specific exceptions 2018-01-31 16:46:35 +01:00
Tux 8764004e92
Merge branch 'master' into master 2018-01-31 01:40:21 -07:00
David Nuñez 78bc6fffad Renamed hash_to_fn to unsafe_hash_to_bn
Just in case someone tries to use it with secret data
2018-01-31 09:30:12 +01:00
David Nuñez 2f5f473c10 Fixing conflicts 2018-01-31 09:24:37 +01:00
David Nuñez e81718140f Fixing conflicts 2018-01-31 09:22:55 +01:00
jMyles 422ae94294 Moving opening and decrypting logic over to PRE. 2018-01-30 23:21:02 -08:00
jMyles cd64f1d89b No more "is_reconstructed" needed. 2018-01-30 23:19:49 -08:00
jMyles 218f33a690 Reintroducing... PRE.decrypt! 2018-01-30 23:19:22 -08:00
jMyles 7b29302f10 Better names for some things. 2018-01-30 23:18:43 -08:00
jMyles 54acbf3fcf New, longer representation of a reconstructed (activated?) Capsule. 2018-01-30 22:39:54 -08:00
David Nuñez cd22679c44 Corrected error message 2018-01-30 13:08:30 +01:00
David Nuñez f9cf9ddbf3 Deterministic generation of parameters h and g
h and u are now deterministically generated as hashes of g plus a
per-param label, using the Utils.hash_to_point method
2018-01-30 13:03:41 +01:00
David Nuñez b7bd6e8d85 Added hash_to_point function 2018-01-30 12:21:33 +01:00
jMyles d95bedaef2 Methods for establishing equality. 2018-01-29 07:51:26 -08:00
jMyles 5d9696a29b Typo pointed out by @cygnusv. 2018-01-29 07:36:42 -08:00
jMyles f375e99b32 Capsule.get_contents() is now Capsule.decrypt() and Capsule._get_contents(). 2018-01-28 21:07:48 -08:00
jMyles b6624bc688 Hanging contents() that was no longer used. 2018-01-28 21:07:30 -08:00
jMyles f3be38b634 Removing Capsule.open() 2018-01-28 18:08:01 -08:00
jMyles b4744d8731 pre.decrypt_reencryted moved to capsule.get_contents 2018-01-28 18:02:44 -08:00
jMyles 5e66579d4d Made decapsulate_reencrypted public. 2018-01-28 17:50:49 -08:00
jMyles 68c9c27bbb Custom exception & raising it in proper place. Closes #39. 2018-01-27 18:27:50 -08:00
jMyles 0240b0c1b2 Removing logic branch for the case where we don't have original capsule data. Closes #37. 2018-01-27 18:11:39 -08:00
jMyles d943ba297a Moving _reconstructed_bytes into to_bytes. 2018-01-26 21:53:24 -08:00
jMyles 0eef0c289c Touching up TODOs. 2018-01-26 21:48:00 -08:00
jMyles c0782a2696 Single from_bytes method. See https://github.com/nucypher/pyUmbral/pull/24#discussion_r162469880 2018-01-26 21:37:01 -08:00
jMyles feb967da72 Prviate reconstruct method. 2018-01-26 21:27:29 -08:00
jMyles 84b4f07d7a A quick sketch of logic for handling cases where we have a Capsule but no original components. See #37. 2018-01-26 21:27:29 -08:00
jMyles a0530ec7b3 Private component names. 2018-01-26 21:27:29 -08:00
jMyles cc7649ff2c Removing methods for Point addition. 2018-01-26 21:27:29 -08:00
jMyles f792fdf54e PRE is no longer injected. 2018-01-26 21:27:29 -08:00
jMyles 6a18e5f420 Method to get components for comparison. 2018-01-26 21:27:29 -08:00
jMyles 33e655a403 We don't know for sure that we'll have the original data to check - maybe kick this out to a separate method? 2018-01-26 21:27:28 -08:00
jMyles 2e2362e856 Using method to get points. 2018-01-26 21:27:28 -08:00
jMyles 22007a26cc More fine-tuning of names. 2018-01-26 21:27:28 -08:00
jMyles 9dee6dcccc Making byte attributes private. 2018-01-26 21:27:28 -08:00
jMyles cb32627dec Methods from instantiating from bytes of either original or reconstructed; introducing concept of "contents." 2018-01-26 21:27:28 -08:00
jMyles 0d2a697916 New Capsule.__init__ allows instantiation from either component set. 2018-01-26 21:27:28 -08:00
jMyles 50f416d85e Some PEP8 cleanup. 2018-01-26 21:27:28 -08:00
jMyles da71b5c377 We're not using default_backend at the moment. 2018-01-26 21:27:28 -08:00
jMyles c3346ca53f Point.from_bytes is now a classmethod. 2018-01-26 21:27:28 -08:00
Tux ceec8ad8ed
Merge pull request #33 from tuxxy/aead-dem
Implement cryptography.io's AEAD for ChaCha20-Poly1305 in the UmbralDEM
2018-01-26 00:21:31 -07:00
tuxxy 050b0b3bdd Use constants in tests and add comment 2018-01-25 17:06:17 -07:00
tuxxy 5043a49488 Fix UmbralParameters on PRE.__init__ 2018-01-24 18:18:22 -07:00
tuxxy 831a2b6d67 Set params h and u to generator point and use default UmbralParameters on __init__ 2018-01-24 15:16:34 -07:00
tuxxy 405a93cd35 Add tests for DEM and some fixes 2018-01-24 14:52:49 -07:00
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