diff --git a/umbral-pre-python/docs/index.rst b/umbral-pre-python/docs/index.rst index acb94f43..179577fe 100644 --- a/umbral-pre-python/docs/index.rst +++ b/umbral-pre-python/docs/index.rst @@ -38,6 +38,14 @@ API reference Generates a new :py:class:`SecretKey` using ``label`` as a seed. + .. py:method:: __bytes__() -> bytes + + Serializes the object into a bytestring. + + .. py:staticmethod:: from_bytes(data: bytes) -> SecretKey + + Restores the object from a bytestring. + .. py:class:: PublicKey An ``umbral-pre`` public key object. @@ -46,10 +54,34 @@ API reference Creates a public key corresponding to the given secret key. + .. py:method:: __bytes__() -> bytes + + Serializes the object into a bytestring. + + .. py:staticmethod:: from_bytes(data: bytes) -> PublicKey + + Restores the object from a bytestring. + + .. py:method:: __hash__() -> int + + Returns a hash of self. + .. py:class:: Capsule An encapsulated symmetric key. + .. py:method:: __bytes__() -> bytes + + Serializes the object into a bytestring. + + .. py:staticmethod:: from_bytes(data: bytes) -> Capsule + + Restores the object from a bytestring. + + .. py:method:: __hash__() -> int + + Returns a hash of self. + .. py:function:: encrypt(pk: PublicKey, plaintext: bytes) -> Tuple[Capsule, bytes] Creates a symmetric key, encrypts ``plaintext`` with it, and returns the encapsulated symmetric key along with the ciphertext. ``pk`` is the public key of the recipient. @@ -81,6 +113,18 @@ API reference Verifies the integrity of the fragment using the signing key and, optionally, the delegating and the receiving keys (if they were included in the signature in :py:func:`generate_kfrags`). + .. py:method:: __bytes__() -> bytes + + Serializes the object into a bytestring. + + .. py:staticmethod:: from_bytes(data: bytes) -> KeyFrag + + Restores the object from a bytestring. + + .. py:method:: __hash__() -> int + + Returns a hash of self. + .. py:class:: CapsuleFrag A reencrypted fragment of an encapsulated symmetric key. @@ -89,6 +133,18 @@ API reference Verifies the integrity of the fragment. + .. py:method:: __bytes__() -> bytes + + Serializes the object into a bytestring. + + .. py:staticmethod:: from_bytes(data: bytes) -> CapsuleFrag + + Restores the object from a bytestring. + + .. py:method:: __hash__() -> int + + Returns a hash of self. + Indices and tables ==================