protocol

In TF Encrypted, a protocol represents a certain type of cryptographic protocol to achieve security.

The goal is to allow you to easily play with or use different cryptographic methods by simply changing the protocol.

import tf_encrypted as tfe

tfe.set_protocol(tfe.protocol.SecureNN())
tfe.set_protocol(tfe.protocol.Pond())

Base abstraction for a Protocol.

class tf_encrypted.protocol.protocol.Protocol[source]

Protocol is the base class that other protocols in TF Encrypted will extend.

Do not directly instantiate this class. You should use a subclass instead, such as SecureNN or Pond

tf_encrypted.protocol.protocol.get_protocol() → Protocol or None[source]

Returns the current global protocol.

tf_encrypted.protocol.protocol.memoize(func) → Callable[source]

Decorates a function for memoization, which explicitly caches the function’s output.

Parameters:func (Callable) – The function to memoize
tf_encrypted.protocol.protocol.set_protocol(prot)[source]

Sets the global protocol. E.g. SecureNN or Pond.

Parameters:prot (Protocol) – An instance of a tfe protocol.