Commit Graph

705 Commits (c26f5e6d5b53b57a8d6aa84dcb607071387ea228)

Author SHA1 Message Date
jMyles 0c32deab98 Splitting a MessageKit to get Policy. 2018-02-11 00:52:25 -08:00
jMyles f807113d7d verify_from now takes a MessageKit. 2018-02-11 00:52:10 -08:00
jMyles 5358916ea5 encrypt_for now takes plaintext, returns a MessageKit. 2018-02-11 00:51:21 -08:00
jMyles a3a05d9de0 powers_and_keys can now take UmbralPublicKeys. 2018-02-11 00:50:22 -08:00
tuxxy 1c5c1ab7ad Remove npre from policy.models 2018-02-10 22:11:37 -07:00
tuxxy 542e6b6a5c Fix syntax 2018-02-10 22:08:27 -07:00
jMyles 0c47c00d69 @tuxxy merged my Pull Request, then pushed his history to thunderdome. This commit merges those histories. 2018-02-10 20:39:30 -08:00
tuxxy 2fc5596d5b Add tests for sqlite keystore 2018-02-10 21:26:56 -07:00
jMyles d91426e0e8 Formatting and style changes. 2018-02-10 19:39:03 -08:00
jMyles fee2b29836 Red lines through PFrag. 2018-02-10 19:28:34 -08:00
jMyles 438ecf2e29 New splitters for new hashes. 2018-02-10 19:26:54 -08:00
jMyles 044c636a77 New hash digest length for dht bytestring splitter. 2018-02-10 19:24:27 -08:00
jMyles 84e6f7d410 Signatures returned from keypairs. 2018-02-10 19:12:45 -08:00
jMyles 625ec75b0f Better error if message_types aren't compliant with BytestringSplitter. 2018-02-10 19:09:29 -08:00
jMyles 440e3e13b6 Signature r+s concatenation serialization. 2018-02-10 19:09:29 -08:00
jMyles 24bbac9ae1 Unlike PublicKey, UmbralPublicKey can't be init'd with bytes. 2018-02-10 19:09:29 -08:00
jMyles 9ce9a8a49b Bytes de/serialization for Signature has changed a bit now that we're using cryptography.io.
For a question about this method of serialization r and s, see: https://stackoverflow.com/questions/48726642/whats-the-proper-way-to-get-a-fixed-length-bytes-representation-of-an-ecdsa-sig/48727351#48727351
2018-02-10 19:09:29 -08:00
jMyles ddd0d69ac8 We make a Signature our of r and s now - it'll be 64 bytes with secp256k1. 2018-02-10 19:09:29 -08:00
jMyles 29aeb86bc5 We don't hash messages in advance anymore; cryptography.io does it. 2018-02-10 19:09:29 -08:00
jMyles c7e13cb861 KeyPair gets init'd with bytes. 2018-02-10 19:09:29 -08:00
jMyles 8a6ac628bb Use the sig_keypair's sign method. 2018-02-10 19:09:29 -08:00
jMyles ad3af0fe8f Gotta actually grab the public key. 2018-02-10 19:09:29 -08:00
jMyles 8ecb791823 Moved mutable out of params list. 2018-02-10 19:09:29 -08:00
jMyles 817277623f Two hash digest lengths are better than one! 2018-02-10 19:09:29 -08:00
jMyles adf2eee2e8 API no longer returns Signature. 2018-02-10 19:09:29 -08:00
jMyles 1eef746f7c Alice implements new kfrag generation method. 2018-02-10 19:09:29 -08:00
jMyles 44d9820f7b Alice now generates KFrags with umbral. Woo! 2018-02-10 19:09:28 -08:00
tuxxy 893ae8d24c Implement Keystore with new models 2018-02-10 17:01:11 -07:00
tuxxy b894ca6d18 Implement get_fingerprint on Keypair 2018-02-10 15:43:00 -07:00
tuxxy 03ffe8c9cd Merge branch 'rm-crypto' of github.com:tuxxy/nucypher-kms into rm-crypto 2018-02-10 15:24:55 -07:00
tuxxy 439a80444b Add keystore models 2018-02-10 15:24:42 -07:00
jMyles 65940dd0fe Preparing to use UmbralPublicKey. 2018-02-09 20:44:16 -08:00
jMyles acc31b7757 Using UmbralPrivate key for splitting in protocols. 2018-02-09 20:38:10 -08:00
jMyles 9627dbca0e Using MessageKit for decrypting. 2018-02-09 20:37:55 -08:00
jMyles 3a1fcc349d Adding public key (assuming secp256k1) to constants 2018-02-09 20:36:15 -08:00
tuxxy 5b73db801e PEP8 changes to characters 2018-02-09 21:15:50 -07:00
tuxxy 7f7c1207ef Set HASH_DIGEST_LENGTH to 64 2018-02-09 19:52:43 -07:00
tuxxy a761466d38 Implement Umbral in Keypairs 2018-02-09 19:44:20 -07:00
tuxxy 39b70336d3 Add what I got so far -- Keypair 2018-02-09 14:25:52 -07:00
jMyles 5741702891 Fixed NameError for Signature.__bytes__. 2018-02-09 13:03:52 -08:00
jMyles 48bfbacd5d KeypairBasedPower.__init__ - @tuxxy is perhaps going to move this down to KeyPair. 2018-02-09 13:03:10 -08:00
tuxxy b694877f70 Implement ecdsa_sign in API and call it in signature 2018-02-09 13:29:04 -07:00
tuxxy ba2200487f Add what I got - KeypairBasedPower 2018-02-09 12:27:12 -07:00
tuxxy 1cafba8e34 Use 'ECDSA Signature' on __repr___ 2018-02-09 11:04:44 -07:00
tuxxy 61eb1a11f4 Merge branch 'rm-crypto' of github.com:tuxxy/nucypher-kms into rm-crypto 2018-02-09 03:44:30 -07:00
tuxxy 9eb303506d Use PyUmbral keys in Signature 2018-02-09 03:44:15 -07:00
jMyles fd8ba6670d SigningKeypair implements new ECDSA sign function. 2018-02-09 02:34:26 -08:00
jMyles c11e9c77f8 New ECDSA sign function. 2018-02-09 02:34:25 -08:00
tuxxy 75412b9a3d Remove deprecated files 2018-02-08 14:52:17 -07:00
jMyles 50aca7d66f Reflecting new location for fragments. 2018-02-07 16:22:28 -08:00
tuxxy f1a6689b7a Use umbral.KFrag and KFRAG_LENGTH for set_policy 2018-02-07 03:31:27 -07:00
jMyles 6d2c9e3d7b Reflecting deprecated crypto modules. 2018-02-07 02:16:45 -08:00
jMyles 0d964ca080 Removing various imports of the ole' fragments module. 2018-02-07 02:16:44 -08:00
tuxxy a55149fa06 Add cryptographic bytestring length constants from PyUmbral 2018-02-07 01:19:51 -07:00
tuxxy e84b772af5 Remove PRE declaration 2018-02-07 00:14:30 -07:00
tuxxy da70c11b06 Delete old code that will be replaced with pyUmbral 2018-02-06 22:07:08 -07:00
tuxxy 553ae20f09 Merge branch 'master' of github.com:nucypher/nucypher-kms 2018-02-06 18:36:58 -07:00
jMyles c6d050aca7 Making explicit which address and port are for Ursula's DHT interface. 2018-02-06 17:16:21 -08:00
jMyles cc80a065e0 Character.from_public_keys now takes a list of tuples. 2018-02-06 17:15:53 -08:00
jMyles 12f7990a09 Alice script properly sends a Contract and then, subsequently, sends a KFrag. 2018-02-06 03:08:23 -08:00
jMyles 1ff8d51515 Better doctstring for Policy. And something something agreement. 2018-02-05 23:40:21 -08:00
jMyles bdf738aef9 Serialization for Contract. 2018-02-05 23:30:07 -08:00
jMyles e263558218 Allow BytestringSplitter to use from_bytes if that method is provided. 2018-02-05 23:30:07 -08:00
jMyles 63d7990aa6 Contract Consideration is now a REST activity. 2018-02-05 23:30:07 -08:00
jMyles de3d9e6c01 Create an Ursula from a REST URL. Why not? 2018-02-05 23:30:01 -08:00
jMyles 672f796965 Some style tweaks for Character. 2018-02-05 23:08:55 -08:00
jMyles 543465b99d Implementing from_public_keys in various places. 2018-02-05 11:26:50 -08:00
jMyles 3db71115f6 Characters can now be created from either a signing or encryption key. Fixes #156. 2018-02-05 11:25:17 -08:00
jMyles b482c7a1be Only tell PowerUps to generate keys if the Character is_me. 2018-02-05 11:05:28 -08:00
jMyles 81c534041f Tracking both REST and DHT info on Ursula. 2018-02-04 23:39:40 -08:00
tuxxy 1ce78759c1
Merge branch 'master' of github.com:nucypher/nucypher-kms 2017-12-22 22:41:19 -07:00
jMyles 83aae67c7b Making Contract details explicit. 2017-12-15 21:50:36 -08:00
jMyles 6819456f43 Tearing out remainder of ChallengePack 2017-12-15 21:50:09 -08:00
jMyles 472d2f0a94 Way better docstring for Policy. 2017-12-15 21:49:45 -08:00
jMyles b30638cbf9 Doing this all on Ursula now. 2017-12-15 21:49:27 -08:00
jMyles 14071b5b9c Stepping up docstring. 2017-12-15 21:49:15 -08:00
jMyles cc7483436d Moving these splitters outta here. 2017-12-15 21:49:01 -08:00
jMyles 319b1f17a5 Instead of saving the contract in memory, saving a dict with details in preparation for a legit data store. See #127. 2017-12-15 21:48:18 -08:00
jMyles 8e0f9fb203 Ursula reconstructing contract from mock saved data. 2017-12-15 21:47:52 -08:00
jMyles 0bb62224ef With PolicyGroup gone, there's no need for these nagging managers. 2017-12-15 21:47:02 -08:00
jMyles a224487ecf Exception to raise when suspicious activity is detected and there's no other obvious recourse. 2017-12-15 21:46:14 -08:00
jMyles 9e32c72cc1 Cleaning up some imports and signatures. 2017-12-15 11:13:08 -08:00
jMyles 100e7478b6 Some PolicyGroup methods will now live on Policy. 2017-12-14 21:20:24 -08:00
jMyles 3ed0495d3c _accepted_contracts is a more accurate name than _active_contracts, and also opens up some other logic. 2017-12-14 21:19:59 -08:00
jMyles f0fe1012b9 Massive redlining of PolicyGroup. 2017-12-14 21:19:23 -08:00
jMyles 45ffae7ea4 This was an hrac all along - it was never meant to be called "pfrag" except as a quick experiment. 2017-12-14 21:18:50 -08:00
jMyles 87d25e4ce3 Pushing logic to match KFrags with Contracts down into Policy. 2017-12-14 21:18:25 -08:00
jMyles 5a96e23d40 Logic to find an unassigned kFrag and assign it to a Contract. 2017-12-14 20:36:08 -08:00
jMyles 4cf3d8aac8 Much clearer logic for finding Ursulas. 2017-12-14 20:35:56 -08:00
jMyles 5066cd1ad7 Instead of taking a single Contract, find_ursulas now makes the number of Contracts needed to offer one to each Ursula. 2017-12-14 20:35:22 -08:00
jMyles 7dd0953fa4 Alice can draw up a Contract. 2017-12-14 20:35:05 -08:00
jMyles d85776d80d Ursula is now on Contract, now Policy. 2017-12-14 20:34:47 -08:00
jMyles 5d70de739d More logic updates from Contract. 2017-12-14 20:34:30 -08:00
jMyles ef4cf13dc6 Special error for the scenario in which we have already contacted *too many* Ursulas. 2017-12-14 20:33:56 -08:00
jMyles 5ba1435c21 Moving TreasureMap to Policy (big one! :-) ) 2017-12-14 20:33:41 -08:00
jMyles 8be2c5cf4c Contract now gets updated wit REST payload instead of created anew (because Ursula has already saved it). 2017-12-14 20:33:12 -08:00
jMyles 775da4c670 Contract is identified by hrac. 2017-12-14 20:32:59 -08:00
jMyles 4927dec9e5 Ursula saves contract (although we'll want to do this in a datastore - see #127) 2017-12-14 20:32:22 -08:00
jMyles 567a9734fe Ursula saves KFrag from new Contract class. 2017-12-14 20:32:09 -08:00
jMyles 4e25a0ac04 Much better grant logic. 2017-12-14 20:31:54 -08:00
jMyles 91d46aae6a TODOs around Ursula's Contract storage. 2017-12-14 16:53:44 -08:00
jMyles 2869e1e5e1 Contract takes an Alice directly now, rather than a Policy. 2017-12-14 16:53:20 -08:00
jMyles 2667d0c131 Rolling the remaining PolicyGroup / PolicyOffer details into Contract. 2017-12-14 16:52:58 -08:00
jMyles 0a9002893e For now, Ursula stores Contracts in a dict. 2017-12-14 16:52:36 -08:00
jMyles 0fd71bf07b Enact logic to reflect new Contract. 2017-12-14 12:50:12 -08:00
jMyles fdce4e089c HRAC logic moved to Policy. PolicyGroup is losing weight! :-) 2017-12-14 12:49:50 -08:00
jMyles 4bcec28347 Moving from_ursula (ie, "other end of the wire" logic) to Contract. 2017-12-14 12:49:14 -08:00
jMyles 346883524a Ursula reconstructs the Contract at the other end of the wire. 2017-12-14 12:46:36 -08:00
jMyles 1c677efb6a Moving the rest of the enact logic to Policy. 2017-12-14 12:15:36 -08:00
jMyles 54d593f536 Rethinking PolicyOffer more broadly - it's now a Contract, which is able to formulate its own payload. 2017-12-14 12:15:10 -08:00
jMyles 021f7a25d5 .enact() for Policy 2017-12-14 12:14:37 -08:00
jMyles f68bd91510 Policy ID is immaterial now. Closes #38 wontfix. 2017-12-14 11:40:46 -08:00
jMyles f5abf099af New find_n_ursulas method for Policy. 2017-12-14 11:40:23 -08:00
jMyles 56b2fab5bc Moving activate to PolicyOffer. 2017-12-14 11:40:09 -08:00
jMyles 5638af4e9e Eh, this exception has lived in the wrong place its whole life. 2017-12-14 11:39:38 -08:00
jMyles 1fb92890bb Making KFrag hashable; preparing to use it as a key in `_active_ursulas`. 2017-12-14 11:39:17 -08:00
jMyles c4135b520f Alice passes uri and kFrags to make a Policy. 2017-12-14 11:22:20 -08:00
jMyles 847a0e0e99 Policy now takes multiple kFrags and a URI as arguments. 2017-12-14 11:22:00 -08:00
jMyles f5a0db8603 Moving craft_offer to Policy. 2017-12-14 11:21:37 -08:00
jMyles 7f7139e24f Moving 'n' to Policy. 2017-12-14 11:21:16 -08:00
jMyles 8435ddccdf Alice now makes a Policy instead of a PolicyGroup. 2017-12-14 11:20:57 -08:00
jMyles 899049c3d7 Moved pFrag down to Policy; pFrag stand-in for PolicyGroup. 2017-12-14 10:49:15 -08:00
jMyles fcc3636934 Found a pFrag that escaped refactor. 2017-12-13 20:09:34 -08:00
jMyles ac10e6a3da Merge commit for various Policy and testing Work after PRs are merged. 2017-12-13 10:41:55 -08:00
jMyles 267647a07b Don't need TreasureMap setter anymore. 2017-12-13 10:32:44 -08:00
jMyles ff19d7f276 Payload has always incorrectly used the encrypted TreasureMap instead of ChallengePack - we didn't notice because we aren't doing challenges yet. 2017-12-13 10:32:10 -08:00
jMyles 38e692a526 Making it easier to get an hrac from outside PolicyGroup. 2017-12-13 10:31:31 -08:00
jMyles 6554df9c03 hash convenience method can just be static. 2017-12-13 10:31:15 -08:00
jMyles 9541aa8519 Bob can reconstitute a PolicyGroup before he has the PFrag; nothing wrong with that. 2017-12-13 10:30:47 -08:00
jMyles af969c3ff7 Bob now gets a TreasureMap from just an Alice and URI (not a PolicyGroup). 2017-12-13 10:30:08 -08:00
jMyles 44438e6a50 Moving publish_treasure_map down to PolicyGroup. 2017-12-13 10:29:21 -08:00
jMyles 451095326f Adding __len__ for TreausureMap (kinda surprised we got by without it until now). 2017-12-11 17:03:07 -08:00
jMyles df013d6a00 More replacements of PolicyGroup for the simple hrac. 2017-12-11 17:02:45 -08:00
jMyles cbae3d666e Lookup TreasureMap with provided hrac. It's a good idea to test this, but it's untested as yet. 2017-12-11 17:00:36 -08:00
jMyles 673620e721 Bob doesn't need a PolicyGroup to generate work orders; an hrac will do. 2017-12-11 16:58:40 -08:00
jMyles 588ee82d8e Store TreasureMap when finding from DHT. 2017-12-11 16:56:00 -08:00
jMyles 57b4450d59 Look in own TreasureMaps when following. 2017-12-11 16:55:35 -08:00
jMyles a5fbc5c38d Bob will store TreasureMaps now. 2017-12-11 16:55:00 -08:00
jMyles f8d67c83d6 BaseClass for NetworkyStuff will just return NotImplemented when asked to find a competitive rate. 2017-12-11 14:44:32 -08:00
jMyles 74f51e77f3 New deposit logic for grant: Alice can supply a deposit, look at her default deposit, or, if implemented in her network client, find a competitive rate. 2017-12-11 14:43:51 -08:00
jMyles 1a6650f3e9 convenience method for crafting an offer from a PolicyGroup 2017-12-09 17:21:25 -08:00
jMyles 0cf82a4a0c grant method. 2017-12-09 17:21:08 -08:00
jMyles fd38b2421e Alice gets a PolicyManager at __init__. 2017-12-09 17:19:30 -08:00
jMyles f5ef7c6eaf Sketch of marking a WorkOrder complete. 2017-12-07 20:40:21 -08:00
jMyles 8c243ed399 A WorkOrder is only as long as its PFrags. 2017-12-07 20:38:51 -08:00
jMyles 537a782100 Pushing reencrypt logic down into actual NetworkyStuff instead of just the mock. Makes me psyched! 2017-12-07 20:37:08 -08:00
jMyles 748aea9746 Added TODO showing where Ursula needs to sign response - See #141. 2017-12-07 20:36:36 -08:00
jMyles ad0a2a59cf Check that Ursula sent back the proper number of CFrags. 2017-12-07 20:36:09 -08:00
jMyles 2b1ca0d0d9 New concept for saving WorkOrders by Bob. 2017-12-07 20:35:38 -08:00
jMyles 647e0e4fd7 Bob can now lookup past work orders by PFrag since #137 is closed. 2017-12-07 00:36:35 -08:00