Source code for pyhpke.kem_interface

from .consts import KEMId
from .kem_key import KEMKeyPair
from .kem_key_interface import KEMKeyInterface


[docs] class KEMInterface: """ The KEM (Key Encapsulation Mechanism) interface. """ @property def id(self) -> KEMId: """ The KEM identifier. """ raise NotImplementedError()
[docs] def deserialize_private_key(self, key: bytes) -> KEMKeyInterface: raise NotImplementedError()
[docs] def deserialize_public_key(self, key: bytes) -> KEMKeyInterface: raise NotImplementedError()
[docs] def encap( self, pkr: KEMKeyInterface, sks: KEMKeyInterface | None = None, eks: KEMKeyPair | None = None ) -> tuple[bytes, bytes]: raise NotImplementedError()
[docs] def decap(self, enc: bytes, skr: KEMKeyInterface, pks: KEMKeyInterface | None = None) -> bytes: raise NotImplementedError()
[docs] def derive_key_pair(self, ikm: bytes) -> KEMKeyPair: raise NotImplementedError()