Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Secure channel abstraction #11

Open
wants to merge 31 commits into
base: trusted-aggr-stash
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8e63a53
introduce secure channel class
yanndupis May 7, 2020
779696f
add cooments
yanndupis May 7, 2020
758b5f1
mv _zip_val_key to secure channel
yanndupis May 7, 2020
f256b35
rm config_channels from SecureChannels
yanndupis May 7, 2020
0aebe44
mv channel receive to -move
yanndupis May 8, 2020
b2c8218
mv send and reeceeive to -move
yanndupis May 8, 2020
9564eda
fix names
yanndupis May 8, 2020
1358972
generate clients keys during setup phase
yanndupis May 11, 2020
98631a3
working with keys generated during setup
yanndupis May 12, 2020
aa6c128
separate keys placement from generate keys
yanndupis May 12, 2020
4f00d28
clean up
yanndupis May 12, 2020
9c99865
clean up
yanndupis May 12, 2020
095519a
introduce channel base class
yanndupis May 13, 2020
f779c6b
encrypt method expects a list of eager val
yanndupis May 13, 2020
a16a4a8
clean up
yanndupis May 13, 2020
9c16c9f
rename file to channel_base
yanndupis May 13, 2020
78a59e0
remove key generation and exchange on base class
yanndupis May 13, 2020
4236f3c
method name cleanup
yanndupis May 13, 2020
813fbd7
check if the channel has already been setup
yanndupis May 14, 2020
a913bde
rename sender_index & receiver_index
yanndupis May 14, 2020
a8c4504
store channels in ChannelGrid
yanndupis May 14, 2020
30202bd
fix indentation
yanndupis May 14, 2020
38fdef8
move _place_keys for sk to _generate_keys
yanndupis May 14, 2020
c6e98be
fix bug
yanndupis May 14, 2020
930fad9
_decrypt_values_on_receiver return list of EagerValues
yanndupis May 14, 2020
1355408
clean up
yanndupis May 14, 2020
d8a4106
clean up
yanndupis May 14, 2020
bce9596
input/output constantly internal_representation of fed val
yanndupis May 14, 2020
e6e62e2
cache encrypt and decrypt computation
yanndupis May 14, 2020
ec2dd90
add key setup test
yanndupis May 14, 2020
07404a9
add encryption decryption test
yanndupis May 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tensorflow_federated/python/core/impl/executors/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ py_library(
srcs = ["federating_executor.py"],
srcs_version = "PY3",
deps = [
":channel_base",
":executor_base",
":executor_utils",
":executor_value_base",
Expand All @@ -439,6 +440,12 @@ py_library(
],
)

py_library(
name = "channel_base",
srcs = ["channel_base.py"],
srcs_version = "PY3",
)

py_test(
name = "federating_executor_test",
size = "small",
Expand Down
35 changes: 35 additions & 0 deletions tensorflow_federated/python/core/impl/executors/channel_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import abc
from dataclasses import dataclass
from typing import Tuple, Dict

from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.core.impl.compiler import placement_literals

PlacementPair = Tuple[placement_literals.PlacementLiteral,
placement_literals.PlacementLiteral]


class Channel(metaclass=abc.ABCMeta):

@abc.abstractmethod
async def send(self, value, sender=None, receiver=None):
pass

@abc.abstractmethod
async def receive(self, value, sender=None, receiver=None):
pass

@abc.abstractmethod
async def setup(self):
pass


@dataclass
class ChannelGrid:
channel_dict: Dict[PlacementPair, Channel]

def __getitem__(self, placements: PlacementPair):
py_typecheck.check_type(placements, tuple)
py_typecheck.check_len(placements, 2)
sorted_placements = sorted(placements, key=lambda p: p.uri)
return self.channel_dict.get(tuple(sorted_placements))
Loading