David Núñez
38eff317c4
Fixes deserialization problems for non-default curves
...
* Passes the curve to BystringSplitter
2018-06-06 11:31:33 +02:00
David Núñez
d70d21dfe0
Fix some functions definition according to PEP8
2018-06-05 03:49:22 +02:00
David Núñez
9e126bde29
Fixes bug in Capsule.attach_cfrag that allowed to attach incorrect CFrag
2018-06-05 02:52:23 +02:00
David Núñez
5618b25292
Simplified public API for umbral.pre
...
* Functions in `pre` now only take Umbral keys as arguments, rather than primitive types (Point, CurveBN)
* Remove unnecessary arguments from public facing and internal methods when they can be extracted from a Capsule, UmbralPublicKey or UmbralPrivateKey
* Adds a getter in Capsule for correctness keys
* Adapts the test suite to new simplified API
2018-06-05 02:52:16 +02:00
David Núñez
c736370bcc
Remove params as an argument when possible
...
* Instead, takes params from Capsules or UmbralPublicKeys
* Makes params required in some places (Capsule.init, Capsule.from_bytes, etc)
* Removes pre.CHACHA20_KEY_SIZE constant and use dem.DEM_KEYSIZE instead
2018-06-05 02:11:32 +02:00
David Núñez
c98f723eec
Check that params match when setting correctness keys
2018-06-05 02:11:32 +02:00
David Núñez
03b4138229
Add params when deserializing Capsule
2018-06-05 02:11:32 +02:00
jMyles
e04a44c239
Capsule length now reflects number of attached CFrags.
2018-06-01 23:50:20 -07:00
David Núñez
e14636a2a9
Checks that _set_cfrag_correctness_key is only used in allowed keypairs
2018-05-31 12:47:48 +02:00
David Núñez
6a4c1237e5
Renaming keypairs (encrypting --> receiving)
...
* Fixes some weird test patterns, where split_rekey is used from Alice to Alice
2018-05-31 12:46:43 +02:00
jMyles
a9e431a152
params now injected into Capsule one - in __init__
2018-05-30 18:28:54 -07:00
jMyles
e6dafb956e
Modifications in responses to various discussions and comments throughout the day.
2018-05-30 15:51:33 -07:00
jMyles
9e05cf436c
set_keys instead of set_three_keys; using it in test_simple_api.
2018-05-30 13:12:48 -07:00
jMyles
d8f5d53884
Remoing get-or-create flow in favor of simple setting.
2018-05-30 12:44:07 -07:00
jMyles
71db482fc5
More complete tests for cfrag attachment.
2018-05-29 23:33:14 -07:00
jMyles
cb7bbcdbed
We need the verifying key also.
2018-05-29 22:03:09 -07:00
jMyles
bf6a375d57
Functions for getting or setting keys on Capsule, and taking them in __init__.
2018-05-29 18:51:49 -07:00
jMyles
3177696f30
Some more code and naming touchups.
2018-05-28 10:54:50 -07:00
jMyles
6038dff98d
Using expected_bytes_length for various crypto entities.
2018-05-26 12:12:33 -07:00
jMyles
a7d203aa44
Tests that were using old fixture now work with new one.
2018-05-25 15:43:19 -07:00
jMyles
8394cf6e44
Message for validating KFrag is now bytes of constituents instead of a BigNum. Fixes #148 .
2018-05-25 14:41:13 -07:00
jMyles
e4792b40ba
Using ECDSA for kfrag signature and verification.
2018-05-24 18:32:54 -07:00
jMyles
0632a53d0e
Signing and verifying using ECDSA instead of Schnorr signature.
2018-05-24 18:07:13 -07:00
tuxxy
53858cd600
Use BytestringSplitter in Capusle deserialization
2018-05-23 04:49:29 -06:00
tuxxy
12bcfe610e
Have Capsule.get_size return an non-activated capsule size by default
2018-05-23 04:49:04 -06:00
tuxxy
4efbe3ddc7
Add get_size method on Capsule
2018-05-23 04:15:56 -06:00
David Núñez
d768cf4a38
Change signatures input from lists to tuples
2018-05-09 01:57:52 +02:00
David Núñez
0dbb86e6f1
Enter KFrag._point_xcoord: an ephemeral pk used during reconstruction instead of Alice's pk
2018-05-09 00:19:23 +02:00
David Núñez
0dd3d4b991
Change KFrag.bn_id to a random byte sequence (Solves #123 )
2018-05-09 00:18:45 +02:00
jMyles
df4bfa3f1b
Proof and verification logic are now wraped to keep all "whitepaper" representations in pre and _pre.
2018-05-06 14:36:19 -07:00
jMyles
9cd3c9c2a3
point_bob, point_alice -=> pubkey_b_point, pubkey_a_point
2018-05-05 22:28:04 -07:00
jMyles
48aab73ef1
Making `signature_input` a little more straightforward.
2018-05-05 19:03:53 -07:00
jMyles
6d41a45a62
Removing pre._verify_correctness.
2018-05-05 19:03:21 -07:00
jMyles
ee2f9fd0e1
Reworking `_prove_correctness` to match the flow of `_verify_correctness`
2018-05-05 19:03:21 -07:00
jMyles
af9d8b251d
Updating caller logic to use new `CapsuleFrag._verify_correctness`
2018-05-05 19:03:21 -07:00
David Nuñez
aeb8ad3298
Fix calls to CurveBN.hash()
2018-05-02 01:25:42 +02:00
David Nuñez
ce3caf9dfb
Remove unused import hmac
2018-04-30 00:19:35 +02: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
923ad2944f
Rename BigNum -> CurveBN
...
Change all references from BigNum to CurveBN
2018-04-24 12:41:40 -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
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
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
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
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
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
David Nuñez
42e75127ac
k_frag, c_frag --> kfrag, cfrag
2018-03-28 20:59:28 -07: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
1d96f84fca
Uses a constant CHAHCA20_KEY_SIZE instead of unused SecretBox constant
2018-03-07 18:37:33 -07: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
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
Kieran R Prasch
97cceedc30
Creates opeenssl mocked backend pytest fixture.
2018-02-10 04:49:51 -08:00
tuxxy
d65829f977
Add empty pre.py file
2017-12-27 07:08:52 -07:00